Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. -- Steve C |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open new record with selected fields from previous record | Excel Discussion (Misc queries) | |||
Complex comparison of Columns of Data: Extracting unique records after comparison on 4 levels | Excel Programming | |||
Finding last record in month for each of several types of record. | Excel Programming | |||
Record Macro - Record custom user actions | Excel Programming | |||
Need help autopopulating next new record with previous record data | Excel Programming |