Compare Worksheet Values

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
 
J

JMay

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top