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: 1
Default Tips on searching and comparing multiple columns on separate sheets.

I am trying to write some code that will allow a user to compare data
columns from two separate sheets based on one or more key columns.
The first sheet comes from some laboratory instruments which generate
data associated with one or more columns making a unique key. The
second sheet is a scrubbed version of the first sheet to send to a
client. It also will have the key columns but their position may
vary. The goal is to make sure the second sheet's data columns match
those of the first.

There is a user form that allows one to select which columns on each
sheet represent the keys and which represent the data.

I currently am using several nested FOR loops which traverse through
each sheet to find the matching keys then compare the data columns.
Differences or duplicates are printed into a separate sheet for
reference.
One caveat is that I am not allowed to make changes to either source
or destination sheet.

Here is my algorithm:

For loop through each destination row
For loop through each source row
For loop through each key column
Compare key column
If key columns don't match then Exit For(go to next source
row)
For loop through each data column (All keys match)
Compare data columns and print problems
Next
Next
Next
Next

It works, but is quite inefficient.

Would there be any suggestions on how I might use any Excel built-in
functions, Range methods or such in order to improve the process?

Thank You!
 
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
Searching Multiple sheets in excel BIG FRED Excel Worksheet Functions 3 July 9th 08 12:37 AM
Comparing multiple columns in two sheets [email protected] Excel Worksheet Functions 1 March 30th 07 07:12 PM
Comparing two columns in two separate files K Landsworth New Users to Excel 1 June 15th 06 11:43 AM
searching and collating values in multiple sheets dave99 Excel Discussion (Misc queries) 1 January 7th 06 10:55 PM
comparing columns of text (cross-searching) WorkingWithText Excel Discussion (Misc queries) 0 November 8th 05 02:30 AM


All times are GMT +1. The time now is 11:39 PM.

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

About Us

"It's about Microsoft Excel"