I'm trying to create some VBA code that will allow the user with the click of a button to toggle every other line shading on or off.
I have tried the following which does not work
Code
Sub Macro4()
If Range("A3:Q23").Interior.ColorIndex = 15 Then
Range("A3:Q23").Select
Selection.FormatConditions.Delete
Range("A3").Select
Else
Range("A3:Q23").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=MOD(ROW(),2)"
Selection.FormatConditions(1).Interior.ColorIndex = 15
Range("A3").Select
End If
End Sub
Display More
Any suggestions will be greatly appreciated
Thanks