Thread: [Solved] Conditional Formatting.
View Single Post
 
Old 04-09-2012, 05:01 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

An alternative approach, which doesn't require you to copy the existing data to a new location, is to add a macro like the following to the worksheet's code module:
Code:
Option Explicit
Dim NewVal As String, OldVal As String, NewAddr As String, OldAddr As String
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
NewVal = ActiveCell.Formula
NewAddr = ActiveCell.Address
If OldAddr <> "" Then
  With ActiveSheet.Range(OldAddr)
    If .Formula <> OldVal Then
      .Interior.ColorIndex = 6
    End If
  End With
End If
OldVal = NewVal
OldAddr = NewAddr
End Sub
With this macro, simply changing any cell's contents will change its background colour to yellow.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote