Conditional Formatting across different worksheets

  • Thread starter Thread starter Nicola
  • Start date Start date
N

Nicola

Hi everyone,

I am reposting my message, as the previous one was not clear. I think
that I have to go to VBA, as it was suggested. Does anyone have the
code? The problem is as below:

I have two sheets, one that I use as a control (i.e. a back up) that
I
will call Sheet 2, while Sheet 1 is a duplicate of Sheet 2 and is
sent out to different people for quarterly updates. The Excel file
that I send out for updates has both Sheet1 and Sheet2, but Sheet2 is
hidden.

What I want to do is make the cells in Sheet 1 automatically change
color if they are edited and no longer match Sheet2.

I hope now my problem is clear.

Thank you for your help
 
Hi Nicola,
This code was written in Excel2003 but works in 2007.

'==========================================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cell As Range, Sht As Worksheet
Dim Addr As String

Set Sht = Sheets("Sheet2") 'change the sheet name to suit
For Each Cell In ActiveSheet.UsedRange
Addr = Cell.Address
If Cell <> Sht.Range(Addr) Then
Cell.Font.ColorIndex = 7
Else
Cell.Font.ColorIndex = 0
End If
Next
End Sub
'============================================

It is a worksheet event code so it is easy to set up. Right-click the sheet1
tab and choose View Code. Copy and paste the code into the sheet Module and
Press ALT+Q to return to the sheet. Make some changes to test the code and
save the book.
 
Back
Top