Gary Croxford
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").FormatCondi tions.Add( Type:=xlEx pression, Formula1:="=IF(Q1>U1)")
.SetFirstPriority
.Interior.PatternColorInde x = 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?
I want to format a range of cells on a worksheet using VBA (Excel 2013):
.Range("A3:U" & lngBOMRows).Select
With Columns("A:U").FormatCondi
.SetFirstPriority
.Interior.PatternColorInde
.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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER