Compare Worksheet Values

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

I have two worksheets sheet1 and sheet2. Each cells in
the worksheets are text values. Sheet1 range of cells is
(A1:A1677) and sheet2 range of cells is (A1:A822).

I would like to see if the values in sheet2 are listed in
sheet1. If the value is found in sheet1 then color that
cell background yellow. Compare each cell value in sheet2
against sheet1.

Please help me create a Excel VB macro to complete this
task.

Thank You,

Steven
 
Name your Sheet1 range A1:A1677 "MySheet1Data".
In cell A1 of Sheet2, click on Format, Conditional Formatting and
then choose "Formula Is" and type in:

=COUNTIF(MySheet1Data,A1)>0

then Format button, pattern yellow,,,,
OK, OK

then with format painter - click on A1 of Sheet2 and paint cells A2:A822
Your all set!!
HTH
 
Back
Top