VBA for matching two lists

DrH100

Board Regular
Joined
Dec 30, 2011
Messages
78
Hoppefully someone can help as I have no idea where to start.

I have a workbook that contains 2 worksheets.

In Sheet1 I have a list of unique identifiers in column a (currently it is 25 long) in Sheet2 I have a number of columns of data but in column b for each row are the same unique identifiers.

I have some code that does some stuff (technical term) with the data in Sheet2 but what I would like is some other code that searches through column b (sheet2) and checks that the unique identifer appears in the list in Sheet1 - I would also like it to show a list of any that it finds that don't appear in the list in sheet1 as these will be incorrect entries.

The sheet2 data is currently 3500 lines long but it could be any number of entries.

Once it has done this check, and if it doesn't find any mismatches, I would like it to start my normal code. If it does find any mismatches I would like it to stop so I can examine the entries that it finds.

Any help appreciated.

David
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
DrH100,

1. What version of Excel and Windows are you using?

2. Are you using a PC or a Mac?


Can you post screenshots of the actual raw data worksheets?

And, can you post a screenshot of the worksheet results (manually formatted by you) that you are looking for?

To post your data, you can download and install one of the following two programs:
Excel Jeanie
MrExcel.com | Excel Resources | Excel Seminars | Excel Products

Or, when using Internet Explorer, just put borders around your data in Excel and copy those cells into your post.
See reply #2 the BLUE text in the following link:
http://www.mrexcel.com/forum/about-board/444901-how-create-table-like-aladin.html#post2198045


I would also like it to show a list of any that it finds that don't appear in the list in sheet1 as these will be incorrect entries.

3. Where would this list be placed?

4. Or, we could set the background color of the cells in Sheet1 that do not match the list to red?
 
Upvote 0

Forum statistics

Threads
1,215,652
Messages
6,126,035
Members
449,281
Latest member
redwine77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top