Apply special Conditional Formatting, color cells based on their values.
This was coded before Microsoft added Conditional Formatting into Excel2007.
Can be used as special conditional formatting
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor
If Int(Target.Row / 4) = Target.Row / 4 Then
Select Case Target.Offset(1).Value
Case -10 To 0
icolor = 36
Case 1 To 7
icolor = 44
Case 8 To 15
icolor = 45
Case 16 To 30
icolor = 46
Case 31 To 300
icolor = 3
Case Else
icolor = RGB(1, 1, 1)
End Select
Target.Offset(2).Interior.Color = icolor
End If
End Sub
Dim icolor
If Int(Target.Row / 4) = Target.Row / 4 Then
Select Case Target.Offset(1).Value
Case -10 To 0
icolor = 36
Case 1 To 7
icolor = 44
Case 8 To 15
icolor = 45
Case 16 To 30
icolor = 46
Case 31 To 300
icolor = 3
Case Else
icolor = RGB(1, 1, 1)
End Select
Target.Offset(2).Interior.Color = icolor
End If
End Sub
Target As Range
Views 3,115
Downloads 1,014
CodeID
DB ID
ANmarAmdeen
609
Revisions
v1.0
Wednesday
January
9
2019