I have found a lot of VBA on how to code conditional formatting for more than 3 conditions, all of which are conditioned on the information within the cell.
I have fours cells in a worksheet, each referencing a different cell within the same worksheet. I need to have four conditions to change the color of each. When I use the traditional code, the color will not change with the information in the referenced cell.
This is what I have so far:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("A1:A1000")) Is Nothing Then
Select Case Target
Case ""
icolor = 16
Case Is < 0.505
icolor = 3
Case 0.5 To 0.704
icolor = 6
Case Is > 0.904
icolor = 4
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
Also, is there there a way to target the four individual cells rather than having a range.
Thanks in advance for any help!
Jeannine
I have fours cells in a worksheet, each referencing a different cell within the same worksheet. I need to have four conditions to change the color of each. When I use the traditional code, the color will not change with the information in the referenced cell.
This is what I have so far:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("A1:A1000")) Is Nothing Then
Select Case Target
Case ""
icolor = 16
Case Is < 0.505
icolor = 3
Case 0.5 To 0.704
icolor = 6
Case Is > 0.904
icolor = 4
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
Also, is there there a way to target the four individual cells rather than having a range.
Thanks in advance for any help!
Jeannine