S
Steve C
I am writing a procedure to compare thousands of contact records from two
databases for any differences that exist between duplicate contacts in 17
different fields (Company, Address, phone number, email, etc.). Since both
databases are updated frequently and independently (that's unavoidable), we
need to compare the two on a monthly basis so that both contain the most
updated information as possible.
My approach has been to export all the contacts into one spreadsheet and
sort them by DisplayName (which includes first and last name). My procedure
first compares a DisplayName to the record below it. If it is listed only
once, obviously no duplicate exists and that record's entire row is removed
and pasted elsewhere. If the DisplayName is listed two or more times, the
fields of the first record are used as the basis of comparision to determine
if the other records are different. Differences are highlighted in yellow.
My question has to do with finding the most efficient way (via VBA) to
compare duplicate records. As an example, let's say that Joe Smith is listed
four times. My code currently concatenates all 17 fields for each record
into one string that can be quickly compared to each other. If the strings
for each are identical, there are no differences and those records are
removed. However, if the strings for two or more records are not the same,
then my code starts with the first of the 17 fields (Company) and compares
all the values for each Joe Smith record, highlighting differences that exist
from the first record. It repeats this process for all the fields and then
continues on for all other contacts.
If anyone has a better, more efficient suggestion for improving the
comparison process, I would appreciate hearing from you! Thanks.
databases for any differences that exist between duplicate contacts in 17
different fields (Company, Address, phone number, email, etc.). Since both
databases are updated frequently and independently (that's unavoidable), we
need to compare the two on a monthly basis so that both contain the most
updated information as possible.
My approach has been to export all the contacts into one spreadsheet and
sort them by DisplayName (which includes first and last name). My procedure
first compares a DisplayName to the record below it. If it is listed only
once, obviously no duplicate exists and that record's entire row is removed
and pasted elsewhere. If the DisplayName is listed two or more times, the
fields of the first record are used as the basis of comparision to determine
if the other records are different. Differences are highlighted in yellow.
My question has to do with finding the most efficient way (via VBA) to
compare duplicate records. As an example, let's say that Joe Smith is listed
four times. My code currently concatenates all 17 fields for each record
into one string that can be quickly compared to each other. If the strings
for each are identical, there are no differences and those records are
removed. However, if the strings for two or more records are not the same,
then my code starts with the first of the 17 fields (Company) and compares
all the values for each Joe Smith record, highlighting differences that exist
from the first record. It repeats this process for all the fields and then
continues on for all other contacts.
If anyone has a better, more efficient suggestion for improving the
comparison process, I would appreciate hearing from you! Thanks.