conditionally format based on intersheet cell comparisons

O

oldyork90

I have two sheets, A and B. Both sheets once had the same data. On
sheet A, some cells in col CC have been updated. I want to change the
background of Sht A, col CC cells if the value doesn't match
corresponding cell value in ShtB.

I can do this cell by cell... but can't figure out to select all the
cells at once.

Thank you.
 
M

merjet

Sub NoMatch()
Dim iEnd As Integer
Dim c As Range
Dim rng As Range
iEnd = Sheets("A").Range("CC1").End(xlDown).Row
Set rng = Sheets("A").Range("CC1:CC" & iEnd)
For Each c In rng
If c <> Sheets("B").Range(c.Address) Then c.Interior.ColorIndex = 6
Next c
End Sub
 

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