LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Record Comparison Between Two Databases

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open new record with selected fields from previous record Design by Sue Excel Discussion (Misc queries) 1 June 12th 09 02:24 PM
Complex comparison of Columns of Data: Extracting unique records after comparison on 4 levels ap Excel Programming 2 January 23rd 07 10:12 AM
Finding last record in month for each of several types of record. Richard Buttrey Excel Programming 5 April 4th 05 02:11 AM
Record Macro - Record custom user actions Sal[_4_] Excel Programming 1 December 23rd 04 03:18 PM
Need help autopopulating next new record with previous record data Harry S[_3_] Excel Programming 2 October 1st 03 10:59 PM


All times are GMT +1. The time now is 03:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"