In Excel 2003 I need to use conditional formatting but I've got more than 3 variables. I've done a search and found the code I need but I can't make the changes to get it to run in my speadsheet.
I'm trying to get it to work for Sheet 1 in the range C3 to Z33 and I want different colours for the cell values P, GP, PS and MD.
Would someone be so kind as to amend the code below that I've been trying to use to get it to work for my range and variables.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("A1:A10")) is Nothing Then
Select Case Target
Case 1 To 5
icolor = 6
Case 6 To 10
icolor = 12
Case 11 To 15
icolor = 7
Case 16 To 20
icolor = 53
Case 21 To 25
icolor = 15
Case 26 To 30
icolor = 42
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
Thanks!!
I'm trying to get it to work for Sheet 1 in the range C3 to Z33 and I want different colours for the cell values P, GP, PS and MD.
Would someone be so kind as to amend the code below that I've been trying to use to get it to work for my range and variables.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("A1:A10")) is Nothing Then
Select Case Target
Case 1 To 5
icolor = 6
Case 6 To 10
icolor = 12
Case 11 To 15
icolor = 7
Case 16 To 20
icolor = 53
Case 21 To 25
icolor = 15
Case 26 To 30
icolor = 42
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
Thanks!!