still learning
Well-known Member
- Joined
- Jan 15, 2010
- Messages
- 784
- Office Version
- 365
- Platform
- Windows
Hi I use the following macro to fill every other row with a color to make it easier to read the spreadsheat.
This is the fillcolor macro
When I’m done adding new data to the rows (from A to L),
I put the cursor on the first cell in A where I want to start
Is there a way to have the first marco stop on or after the last row that has data?
Now I have to adjust the range “times” and guess at how many times
mike
VBA Code:
Sub filleveryotherrow()
Dim i As Long
For i = 1 To Range("times").Value
fillcolor
Next i
End Sub
VBA Code:
Sub fillcolor()
ActiveCell.Range("A1:l1").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.COLOR = 15652797
.TintAndShade = 0
.PatternTintAndShade = 0
End With
ActiveCell.Offset(2, 0).Range("A1").Select
End Sub
I put the cursor on the first cell in A where I want to start
Is there a way to have the first marco stop on or after the last row that has data?
Now I have to adjust the range “times” and guess at how many times
mike