My conditional formatting works, but won't apply automatically.
I'm trying to apply a simple conditional format to a column (J), by testing to see if any of the values are contained within the named range "GOOD".
I am using the below VBA, and it works. The problem is it won't actually apply unless, after the script finishes, I go in to Conditional Formatting Rules Manager, open that specific formatting rule, hit OK, and then hit Apply. Then it works. Why won't it apply by itself?
(NOTE: I had to hand-jam this formula manually; hopefully there's no typos)
Formula:
Range("J:J").FormatConditions.Add Type:=xlExpression, Formula1:= _
"=COUNT(SEARCH(GOOD,J1))"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0.499984740745262
End With
Selection.FormatConditions(1).StopIfTrue = False
Bookmarks