I need to highlight the cells in a range MyRange (i.e. B2:B30), where the value of the cell is <= 0 OR > 30). With macro recorder, applying conditional formatting to a single cell, I got this:
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=OR(O5<=0,O5>30)"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0.599963377788629
End With
Selection.FormatConditions(1).StopIfTrue = False
Is there a way to apply the formula to each cell of MyRange?