I wish to colour alternate rows in the worksheet. Sure, there must be some inbuilt feature for doing so which I have been unable to find. But I was trying to do it through VBA. I used the macro recorder to see what code is generated when I color two altenate rows. The code was as follows:
What I want to know is : Is there someway I could ask excel to increment row numbers by 2....
what i mean is.....
and then I will run a counter to keep it incrementing. THe problem is excel does not even seem to understand this...(leave alone incrementing it)
Please guide me through this problem. I am a beginner in VBA and hence I would like to solve this problem through VBA coding only.
Thanks in advance.
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 06.04.2008 by One
'
'
Rows("3:3").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
End Sub
What I want to know is : Is there someway I could ask excel to increment row numbers by 2....
what i mean is.....
x=2
Rows("1+x:1+x").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
and then I will run a counter to keep it incrementing. THe problem is excel does not even seem to understand this...(leave alone incrementing it)
x=2
Rows("x:x").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With(
Please guide me through this problem. I am a beginner in VBA and hence I would like to solve this problem through VBA coding only.
Thanks in advance.