Excel VBA - Search and Compare for new entries Macro

M

matthewacker

Hello All,

I'm trying to compare two columns for new entries. Column A is the
source information and column B is the coulmn to compare against. If
there are new entries in column A I'd like the macro to record these
new entries. Just the values would be perfect. For example if I have
two columns with;
____A____B
1__105__105
2__106__106
3__107__107
4__108__108
5__109__109
6__111__111
7__112__112
8__113__113
9__114__114
10_115__115
11_116__116
12_117__117
13_118__118
14_119__119
15_120
16_121

I would like my macro to tell me that 120 and 121 are not in the second
column. My columns are much longer and can have entries that are not
directly across from one another (example; A3 and B3 may be 103 and 676
respectively). I'm guessing I'll need a search that uses column A as
its search numbers and that it will search through column B and keep
track of what numbers are not found. I can see all the suedo-code in
my head but I'm not good enough yet on VBA to pull this one off. Any
ideas are good ideas.

Thanks everyone in advance.

Matthew Acker
 
F

Frank Kabel

Hi
what are you trying to do with these found values?
If you only want to highlight them you may use the
following non-VBA approach:
- select your data in column A
- goto 'Format - Conditional format'
- enter the following formula
=COUNTIF($B$1:$B$1000,A1)=0
- choose a format to highlight the new entries
 
Top