comparing 2 sheets and list unique and duplicate rows

L

lejahja

Hi,

I'm fairly new to macro programming and I'm hoping someone could help
me. I tried searching this group but I got a bit confused with some of
the programs and hoping that there is one that is someone closer to my
scenario.

What I have is 2 sheets, sheet 1 and sheet 2. Both sheets have the
same columns. A = customer name, B = customer address, C = customer
phone number.

What I want to do is come up with 2 lists, where one is showing all
the customers that are unique to sheet 2. This is to be written to
sheet 3. The other list to show all customers that are the same in
sheet 2 as sheet 1. This is to be written to sheet 4.

Both sheet 3 and 4 also has columns A = customer name, B = customer
address, C = customer phone number.

For comparison in sheet 1 and 2, I would like to use customer name
(column A).

What would the macro look like? Thanks in advance.
 
M

matt

Hi,

I'm fairly new to macro programming and I'm hoping someone could help
me. I tried searching this group but I got a bit confused with some of
the programs and hoping that there is one that is someone closer to my
scenario.

What I have is 2 sheets, sheet 1 and sheet 2. Both sheets have the
same columns. A = customer name, B = customer address, C = customer
phone number.

What I want to do is come up with 2 lists, where one is showing all
the customers that are unique to sheet 2. This is to be written to
sheet 3. The other list to show all customers that are the same in
sheet 2 as sheet 1. This is to be written to sheet 4.

Both sheet 3 and 4 also has columns A = customer name, B = customer
address, C = customer phone number.

For comparison in sheet 1 and 2, I would like to use customer name
(column A).

What would the macro look like? Thanks in advance.

I don't think that you actually need a macro to do this. Do you know
how the vlookup function works in Excel? If you don't know how it
works search the Excel help for "vlookup" and work through the
examples. When referencing the table parameter, I would recommend
using absolute references with the vlookup funciton.

If you are looking for a way to learn VBA then this problem could be a
good starter because at first glance it would seem to me like it is a
good candidate for arrays. If you want more on how to do the VBA then
state so; otherwise, vlookups would be much faster.

Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top