VBA - Find differences in two columns

mprivitt

New Member
Joined
Jul 24, 2012
Messages
8
Hey all,

I'm new to the forums here, but I'm trying hard to get a project done and can't quite figure out how to do this macro...

Problem:

I have two excel workbooks. I want to write a macro that, once clicked, asks me which workbooks I would like to compare. Then, the macro compares column A in workbook 1 with column A in workbook 2 and highlights the numbers in workbook 2 that ARE NOT in workbook 1. The numbers are in no particular order. I merely would like to highlight the numbers in workbook 2, column A that are not in workbook 2, column A.

Help?
 
Maybe you're confused as to what my goal is. I took some screenshots to help you envision it. I have two workbooks - File1 and File2. Before executing the macro, I have the following windows open:

otdo8.png


Then, after executing the macro and clicking "YES" (to activate File1.xlsx), the macro will execute and the windows will now look like this:

cGakz.png


Cells A1:A6 are highlighted in File1 because they are not found in File 2 cells A1:A10.
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
The code is to highlight NOTHING in the workbook in which it starts. It only highlights the second file. And I just revisited the code. No way it is highlighting everything.
 
Upvote 0
If you answer NO, then you get the results you just showed. I just did it and that is what I got. No sure where you're going wrong but that's a fact.
 
Upvote 0

Forum statistics

Threads
1,216,604
Messages
6,131,697
Members
449,666
Latest member
Tommy2Tables365

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