Hi,
I have below if function color coding cell e2 or d2 based on a condition.
However i can get it to work. Can someone please help.
I have below if function color coding cell e2 or d2 based on a condition.
However i can get it to work. Can someone please help.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim R1 As Range, R2 As Range, R3 As Range
Set R1 = Range("CG1")
Set R2 = Range("CF1")
Set R3 = Range("E2")
Set r4 = Range("D2")
If R1.Value = 0 Then
R3.Interior.Color = 6
ElseIf R2.Value = 1 Then
r4.Interior.Color = vbWhite
Else
R3.Interior.Color = 6
End If
End Sub