Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing data based on two columns

I've done a search through the forums here and haven't found what
need. I did get some help at another forum, but it took forever to ru
(longer than it would take to check manually) and management has als
added additional criteria.

What I need to do is compare two worksheets that should contain th
same data, but are sorted differently. Each worksheet is extracted fro
a different database hence the need to compare them. The number of row
in each worksheet will vary and can be anywhere from a couple o
hundred rows to several thousand rows (average 5,000). As a result,
cannot use ranges, instead it needs to stop when it reaches a blan
cell in the first worksheet.

Basically, there are two columns. The data in column B can b
duplicated up to four times (but could be more or less) but it wil
only be listed once for each item in column A. I need to have the dat
in both columns matched to the second worksheet. If both columns match
they should be set to green on both worksheets. If column B matches
but column A doesn't match, continue searching until found. If no
found, highlight columns A and B in first worksheet orange an
continue.

For example:

Worksheet A
R1 Filename1
R2 Filename1
R3 Filename1
R1 Filename2
R2 Filename2
R2 Filename3
R3 Filename4
R4 Filename4

Worksheet B
R1 Filename1
R2 Filename1
R2 Filename3
R3 Filename1
R3 Filename2
R3 Filename3
R4 Filename2
R4 Filename4

Do while not blank
In "P"
For columns 1 to 2
Start with row 2
Get data in column A
Get data in column B

In "B"
Find data matching P:B
If found, does B:A match P:A
If match, highlight cell in A and B green
Return to "P" and highlight cell in A and B green
If no match, continue searching for P:B
If not found, return to "P", highlight P:A and P:B in orange

Get next row in "P"

I know how its supposed to work, just not how to get it to work wit
Excel VBA. Since I won't be running the comparisons, it has to be
macro/VBA so that the users can run it with a couple of clicks - n
copying formulas, etc.

Thanks in advance.
-da

--
Message posted from http://www.ExcelForum.com

Reply
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
Return Corresponding Value Based on Comparing Two Sheets of Data PaulQ Excel Worksheet Functions 6 March 12th 10 05:23 PM
Comparing data from two columns The Goose Excel Worksheet Functions 2 October 8th 09 11:25 PM
Need help comparing data in two columns drew Excel Worksheet Functions 1 February 12th 09 09:14 PM
Comparing data in columns Nick Excel Discussion (Misc queries) 6 August 30th 07 06:37 PM
Comparing columns of data chief775 Excel Discussion (Misc queries) 5 April 14th 06 05:11 AM


All times are GMT +1. The time now is 09:38 AM.

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"