Hi All
I want to change the color of the alternate rows starting from A3, but with unknown number of columns and rows. I have found the code below but I don't know how to apply to an unknown range, please could I have some advice?
I want to change the color of the alternate rows starting from A3, but with unknown number of columns and rows. I have found the code below but I don't know how to apply to an unknown range, please could I have some advice?
Code:
Dim r As Range
Set r = Range("A3:A20")
Dim tmp As Range, i As Integer
For Each tmp In r.Cells
i = i + 1
If i Mod 2 = 0 Then tmp.Interior.Color = RGB(127, 187, 199)
Next tmp
Last edited: