I have written this code below but no matter whether C4 = V3 or not it always formats it to red (colorindex 3) Can anyone see a glowing mistake of mine please
Private Sub Worksheet_Change(ByVal Target As Range)
Set DayOne = Range("C6:D50")
For Each Cell In DayOne
If Range("C4") <> Range("V3") Then
Cell.Interior.ColorIndex = 1
End If
If Range("C4") = Range("V3") Then
Cell.Interior.ColorIndex = 3
End If
Next
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Set DayOne = Range("C6:D50")
For Each Cell In DayOne
If Range("C4") <> Range("V3") Then
Cell.Interior.ColorIndex = 1
End If
If Range("C4") = Range("V3") Then
Cell.Interior.ColorIndex = 3
End If
Next
End Sub