E
Enyaw
I have the following code that changes the colour of a cell depending on the
cells value. Here is my code.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Range("G8:BC95")) Is Nothing Then
With Target
Select Case .Value
Case 0: Target.Interior.ColorIndex = 2
Case 1: Target.Interior.ColorIndex = 6
Case 2: Target.Interior.ColorIndex = 3
Case 3: Target.Interior.ColorIndex = 43
Case 4: Target.Interior.ColorIndex = 41
End Select
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
The problem i have is the fields are already populated and i want to be able
to loop through these values and update the cell colours. Can anyone
help?????
cells value. Here is my code.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Range("G8:BC95")) Is Nothing Then
With Target
Select Case .Value
Case 0: Target.Interior.ColorIndex = 2
Case 1: Target.Interior.ColorIndex = 6
Case 2: Target.Interior.ColorIndex = 3
Case 3: Target.Interior.ColorIndex = 43
Case 4: Target.Interior.ColorIndex = 41
End Select
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
The problem i have is the fields are already populated and i want to be able
to loop through these values and update the cell colours. Can anyone
help?????