I have a report template that colours cells according to their number value higher than a value, lower than a value and in between.
The in-between value will normally include 0.
In my report I have a blank row between groups of data. At present this is being colored green (same as 0 values).
I want blanks to have no colour to them but can’t they the coding right.
Below is my coding, I just want something to add below this to ensure that blanks on column 8 are not colored the same as zeros.
The in-between value will normally include 0.
In my report I have a blank row between groups of data. At present this is being colored green (same as 0 values).
I want blanks to have no colour to them but can’t they the coding right.
Below is my coding, I just want something to add below this to ensure that blanks on column 8 are not colored the same as zeros.
VBA Code:
ActiveSheet.ListObjects("Table").ListColumns(8).DataBodyRange.Select
With Selection.FormatConditions.Add(xlCellValue, xlGreater, "=$C$22")
.Interior.Color = RGB(255, 199, 206)
.Font.Color = RGB(156, 0, 6)
End With
With Selection.FormatConditions.Add(xlCellValue, xlLess, "=$C$23")
.Interior.Color = RGB(200, 200, 255)
.Font.Color = RGB(0, 0, 120)
End With
With Selection.FormatConditions.Add(xlExpression, xlBetween, "=$c$23", "=$C$22")
.Interior.Color = RGB(198, 239, 206)
.Font.Color = RGB(0, 97, 0)
End With