Hi,
[FONT=Verdana, Helvetica, Arial, sans-serif]I have below code that should highlight cells R3, R4, R5 in black. However it is only highlighting R3 and R4 and not R5. Can someone please tell me whats wrong with i.[/FONT]
[FONT=Verdana, Helvetica, Arial, sans-serif]I have below code that should highlight cells R3, R4, R5 in black. However it is only highlighting R3 and R4 and not R5. Can someone please tell me whats wrong with i.[/FONT]
HTML:
Private Sub Worksheet_Change(ByVal Target As Range) Dim R1 As Range, R2 As Range, R6 As Range, R3 As Range, R4 As Range, R5 As Range Set R1 = Range("CG1") Set R2 = Range("CF1") Set R6 = Range("CH1") Set R3 = Range("E2") Set R4 = Range("D2") Set R5 = Range("F2") If R1.Value = 1 Then R3.Interior.Color = vbWhite ElseIf R1.Value = 0 Then R3.Interior.Color = 6 ElseIf R6.Value = 1 Then R5.Interior.Color = vbWhite ElseIf R6.Value = 0 Then R5.Interior.Color = 6 ElseIf R2.Value = 1 Then R4.Interior.Color = vbWhite Else R4.Interior.Color = 6 End If
End Sub