Good afternoon,
I am trying to work with conditional formatting using a macro.
How it works is I select the range I want to format manually then I run this macro.
It doesn't work
When I check the conditional format the formula is wrong. Instead of referencing the correct cell in columns E & F is is referencing E65282 & F65282
What do I need to change?
Code
Sub CondForm()
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=G$1<$E2"
Selection.FormatConditions(1).Interior.ColorIndex = 37
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=G$1>$F2"
Selection.FormatConditions(2).Interior.ColorIndex = 37
End Sub
Display More
Thanks again