S
Shpendi
Hi all
I have the following code to change the color of the cell.
What I need is for exmaple if cell B5 value is 0 to 5 then
Cell B6 Interior color turn into red.
Any ides
Thanks Shpendi
----------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B20:N20")) Is
Nothing Then
With Target
Select Case .Value
Case 0 To 5: .Interior.ColorIndex = 3
Case 6 To 20: .Interior.ColorIndex = 46
Case 21 To 30: .Interior.ColorIndex = 6
Case 31 To 40: .Interior.ColorIndex = 4
Case Is > 41: .Interior.ColorIndex = 10
End Select
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
--------------------------------------------------
I have the following code to change the color of the cell.
What I need is for exmaple if cell B5 value is 0 to 5 then
Cell B6 Interior color turn into red.
Any ides
Thanks Shpendi
----------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B20:N20")) Is
Nothing Then
With Target
Select Case .Value
Case 0 To 5: .Interior.ColorIndex = 3
Case 6 To 20: .Interior.ColorIndex = 46
Case 21 To 30: .Interior.ColorIndex = 6
Case 31 To 40: .Interior.ColorIndex = 4
Case Is > 41: .Interior.ColorIndex = 10
End Select
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
--------------------------------------------------