I found this answer for an Excel VBA, but I'm having trouble converting it to Access VBA (Conditional Formatting using Excel VBA code).
Here's my current code:
with ws
With .Cells(1, 1).FormatConditions.Add(Type:=xlExpression, Formula1:="=IF($J2=""Y"";TRUE;FALSE)")
.Font.Color = -10092544
.StopIfTrue = False
StrSearchCriteria = "A2:D" & lRow
.FormatConditions(1).ModifyAppliesToRange Range(StrSearchCriteria)
End With
With .Cells(1, 1).FormatConditions.Add(xlCellValue, xlEqual, "=""Closed (New)""")
.Font.Color = -16776961
.StopIfTrue = False
StrSearchCriteria = "A2:K" & lRow
.FormatConditions(2).ModifyAppliesToRange Range(StrSearchCriteria)
End With
End With
I'm getting the error "Invalid procedure call or argument".
What am I missing? Thanks