Question
April 8, 2009 at 09:15 AM
david.go

unlimited conditional formatting

by david.go . Updated 17 years, 5 months ago

Can someone help me?
I have this program ( see below )
This program only allowed me to compare the value in cell a1, b1, c1 and d1.

I need to compare the value to its correspond rows. I.e for value in E1 compare to A1-D1, for Value for E2 compare to A2-D2 etc

Thanks for the help in advance

Private Sub Worksheet_Change(ByVal Target As Range)
Set MyPlage = Range(“E1:E5”)
For Each Cell In MyPlage

If Cell.Value = Range(“A1”) Then
Cell.Interior.ColorIndex = 3
End If
If Cell.Value = Range(“B1”) Then
Cell.Interior.ColorIndex = 4
End If
If Cell.Value = Range(“C1”) Then
Cell.Interior.ColorIndex = 18
End If
If Cell.Value = Range(“D1”) Then
Cell.Interior.ColorIndex = 6
End If

If Cell.Value <> Range(“A1”) And Cell.Value <> Range(“B1”) And Cell.Value <> Range(“C1”) And Cell.Value <> Range(“D1”) Then
Cell.Interior.ColorIndex = xlNone
End If

Next
End Sub

This discussion is locked

All Comments