Link to home
Start Free TrialLog in
Avatar of Gary Croxford
Gary CroxfordFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VBA Conditional Formatting Runtime Error '5' Invalid Procedure Call

Thank you for looking at my question,

I want to format a range of cells on a worksheet using VBA (Excel 2013):

    .Range("A3:U" & lngBOMRows).Select
   
    With Columns("A:U").FormatConditions.Add(Type:=xlExpression, Formula1:="=IF(Q1>U1)")
     .SetFirstPriority
     .Interior.PatternColorIndex = xlAutomatic
     .Interior.Color = 15773696
     .StopIfTrue = True
    End With


For the range A3: last cell in U, if the value in Q is greater than U


but I get a runtime error and invalid procedure call message.

This also happened when I tried to set the font of a range of cells.

I looked in the References, there aren't any there flagged as missing, presumably there is one that hasn't been ticked but I don't know which it is can you help?
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary Croxford

ASKER

Fixed the procedure call error, thank you