Thanks Jeff
I have changed the code and added the cell i want the formula to work in "M31" i am getting conditional formatting in that cell but it dose not appear to be highlighting it.
Sub condition()
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=""OR(" & Replace(Selection.Range("M31").Address, "$", "") & "<$L$31*$R$31," & Replace(Selection.Range("M31").Address, "$", "") & ">$L$31*$Q$31)"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
MsgBox finished
End Sub
Bookmarks