Using Two Colors of Data Bars in a Range
Sub AddTwoDataBars()
With Range("A1:D10")
.Select ' The .Formula below requires .Select here
.FormatConditions.Delete
.FormatConditions.AddDataBar
.FormatConditions(1).BarColor.Color = RGB(0, 255, 0)
.FormatConditions(1).BarColor.TintAndShade = 0.25
.FormatConditions.AddDataBar
.FormatConditions(2).BarColor.Color = RGB(255, 0, 0)
.FormatConditions(1).Formula = "=IF(A1>9,True,False)"
End With
End Sub
Related examples in the same category