C
Cool Sport
Hi everyone,
I am using VBA to format a big range of data whose even and odd rows are
formatted differently. Currently I use this code:
(myRange has 3000 rows and 100 columns)
With myRange
.Interior.ColorIndex = 2
For i = 2 To .Rows.count Step 2
.Rows(i).Interior.ColorIndex = 3
Next i
End With
The For loop seems to slow down my code. Is there any way to create a
range of even/odd rows. I tried the following way but I didn't work.
worksheets(1).range("A2:CV2,A4:CV4,....
...,A3000:CV3000").Interior.ColorIndex = 3
Your help or suggestion is very appreciated.
I am using VBA to format a big range of data whose even and odd rows are
formatted differently. Currently I use this code:
(myRange has 3000 rows and 100 columns)
With myRange
.Interior.ColorIndex = 2
For i = 2 To .Rows.count Step 2
.Rows(i).Interior.ColorIndex = 3
Next i
End With
The For loop seems to slow down my code. Is there any way to create a
range of even/odd rows. I tried the following way but I didn't work.
worksheets(1).range("A2:CV2,A4:CV4,....
...,A3000:CV3000").Interior.ColorIndex = 3
Your help or suggestion is very appreciated.