View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
kounoike[_2_] kounoike[_2_] is offline
external usenet poster
 
Posts: 126
Default Loop macro error

Delete "With" or add "End With" something like below
One more thing, there is no objects or property like ActiveRange, i think
this should be ActiveCell.

Range("7:7").Select 'Set range to start point
Do While ActiveCell.Value < ""
With Selection
.Interior.ColorIndex = 35
ActiveCell.Offset(6, 0).Select
End With
Loop

keiji

"Kirsty" wrote in message
...
Hi,

I am trying to write a macro that will loop through my spreadsheet until
there is no more data. I want it to start at row 7, then colour the row
(or
just cells A to AD) to colour 35. I have written the macro below, however
am
coming up with an error that states there is no Do when trying to run it.

Can anyone help?


Range("7:7").Select 'Set range to start point
Do While ActiveCell.Value < ""
With Selection.Interior.ColorIndex = 35
ActiveRange.Offset(6, 0).Select
Loop

Thanks
Kirsty