I recorded the following macro for conditional formatting and it works great within the current selected cell range that starts at row 13. What do I need to add/change to run it depending on the selection since the range may vary? Thank you.
Code
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=IF(COUNTA($A13)=1,MOD(SUBTOTAL(3,$A$13:$A13),3)=0,0)"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249946592608417
End With
Selection.FormatConditions(1).StopIfTrue = True
End Sub
Display More