Conditional Formatting using Excel VBA
Here is a small snippet for FormatConditions.
Sub Format_Condition_Example()
Dim oFc As FormatCondition
Dim oRange As Range
Set oRange = Range("B2:B5")
Set oFc = oRange.FormatConditions.Add(xlCellValue, xlLess, "0.5")
oFc.Interior.ColorIndex = 3
Set oFc = oRange.FormatConditions.Add(xlCellValue, xlBetween, "0.5", "0.80")
oFc.Interior.ColorIndex = 6
Set oFc = oRange.FormatConditions.Add(xlCellValue, xlGreater, "0.80")
oFc.Interior.ColorIndex = 4
End Sub
Excel Formatting Conditions
See also:
No comments:
Post a Comment