Application: Excel 2003
To improve the visual layout I want to give the odd and even rows in the selected area a different color.
I'm trying to this by selecting the area and run the macro below:
Running the macro it gives all the cells the same color.
How can I solve this problem and get the odd and even rows differently colored.
To improve the visual layout I want to give the odd and even rows in the selected area a different color.
I'm trying to this by selecting the area and run the macro below:
Code:
Sub rowclr()
If ActiveCell.Row Mod 2 Then
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.249977111117893
.PatternTintAndShade = 0
End With
Else
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
.PatternTintAndShade = 0
End With
End If
End Sub
Running the macro it gives all the cells the same color.
How can I solve this problem and get the odd and even rows differently colored.