Excel friends,
I am using the code below to change some cells conditional formatting. Since VBA sets "cel.Address" as an absolute reference by default. How can "cel.Address" be modified to be applied as a Relative Reference?
Thanks for any help!
I am using the code below to change some cells conditional formatting. Since VBA sets "cel.Address" as an absolute reference by default. How can "cel.Address" be modified to be applied as a Relative Reference?
Code:
For Each cel In Rng.Cells
With cel
cel.Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=LEN(TRIM(" & cel.Address & "))=0"
With Selection.FormatConditions(1).Font
'Other formatting code
End With
End with
Next cel
Thanks for any help!