Sub ChangeColor()
Dim cl As range
On Error Resume Next
For Each cl In ActiveSheet.UsedRange.Cells
If Len(Trim$(cl)) > 0 Then
If InStr(cl, "<>") > 0 Then _
cl.Characters(Start:=InStr(cl, "<>") + 2, Length:=Len(cl)).Font.ColorIndex = 3
End If
Next
End Sub
Sub TrackDifferences()
Dim rng As range, cl As range, sht2 As Worksheet, sht1 As Worksheet
Set sht2 = Sheets("Sheet2")
Set sht1 = Sheets("Sheet1")
Set rng = sht1.UsedRange 'set variable rng to the range selected
application.ScreenUpdating = False
For Each cl In rng.Cells 'loop through all cells of the selected range
If sht2.Cells(cl.Row, cl.Column) <> cl Then _
sht2.Cells(cl.Row, cl.Column).Interior.ColorIndex = 3
Next
application.ScreenUpdating = True
End Sub
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)