revised if condition

  • Thread starter Thread starter ranjan.khan
  • Start date Start date
R

ranjan.khan

I have 2 workbooks: wkbook1 and wkbook2

In each workbook I am referring to Sheet1.
Each workbook-Sheet1 has only one column (column A) with content.

There are 10 rows with numbers in them. Sometimes these rows will vary
depending on the updates. I.e. wkbook1 may have 5 rows of content, but
wkbook2 may have 8 rows of content. Keep in mind that the content is
only in Column A of both workbooks.

I want to be able to compare both workbooks to see if the content in
their respective Column A match. If there is a number (that is in
wkbook2) that doesn't match what is in wkbook1, then I want to
highlight with yellow those cells in wkbook2.

For example here is the content of both workbooks:

wkbook1 wkbook2
23 23
15 15
66 66
24 24
16
19

Notice that wkbook2 has 2 more different numbers in its column. 16 and
19
What I want to do now is to highlight those 2 cells with yellow.

NOTE: wkbook1 will always be a subset of wkbook2.

Can you provide a VBA code for this?

Thanks.
 
ranjan,
This is what I came up with, without using VBA code.
In column B in workbook2; B1"=IF([Book1.xls]Sheet3!$A$1=A1,1,0)
In column A in workbook2: A1,conditional formatting:
Condition 1
Select"Formula Is" and "=$B$1<1"
Format, then Patterns. Select the color that will make it easy for you to
recognize.
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

Back
Top