I have the code below in my worksheet and I am not receiving any error messages however nothing is happening in the cell whenever a change is made? Someone please help.
The conditional formatting only applies to 1 cell (S25), I need the cell to change based on the number in the cell. For example, if 6,003 is in the cell then I need it to be green, if 25,004 is in the cell then I need it to be tan, etc...)
Am I missing a piece of code or can anyone provide insight on the possible problem?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("S25")) Is Nothing Then
Select Case Target
Case 1 To 6000
icolor = 35
Case 6001 To 25000
icolor = 37
Case 25001 To 50000
icolor = 40
Case 50001 To 75000
icolor = 4
Case 75001 To 100000
icolor = 6
Case 100001 To 400000
icolor = 3
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
The conditional formatting only applies to 1 cell (S25), I need the cell to change based on the number in the cell. For example, if 6,003 is in the cell then I need it to be green, if 25,004 is in the cell then I need it to be tan, etc...)
Am I missing a piece of code or can anyone provide insight on the possible problem?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("S25")) Is Nothing Then
Select Case Target
Case 1 To 6000
icolor = 35
Case 6001 To 25000
icolor = 37
Case 25001 To 50000
icolor = 40
Case 50001 To 75000
icolor = 4
Case 75001 To 100000
icolor = 6
Case 100001 To 400000
icolor = 3
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub