De-Dupe Records Based on Two Fields.

O

onlythebest

I've got 5 coumns, of data : Company, Address, C_S_Z, Phone, Fax : an
about 600 rows of companies.

Since some Comapnies share the same name I need a Macro that ca
de-dupe based on two fields.. preferably Company and Address.

The Current de-dupe macro i use works. but only for one field :(

Any help would be amazing!!!!.
 
B

Bill

onlythebest said:
I've got 5 coumns, of data : Company, Address, C_S_Z, Phone, Fax : and
about 600 rows of companies.

Since some Comapnies share the same name I need a Macro that can
de-dupe based on two fields.. preferably Company and Address.

The Current de-dupe macro i use works. but only for one field :(

Any help would be amazing!!!!..

Try joining the respective strings together with "&". Your current macro
probably does some kind of comparison of one string against another.
Instead of comparing one string to another, compare two strings joined with
"&" (which makes one string). Tough to describe without your code.

Let's say Company Name is in column A and Address is in column B. Maybe
your code reads:

If A2 = A1 Then
Range("A2").EntireRow.Delete
End If

Try this:

If A2&B2 = A1&B1 Then
Range("A2").EntireRow.Delete
End If

Curious if that does it for you...

- Bill
 

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