Re: Loop macro error
- From: Kirsty <Kirsty@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 4 Mar 2008 15:01:01 -0800
Thanks Mark,
I want every 6 rows, from row 7 on the *** to be coloured 35, but only on
the one specified work***
"Mark Ivey" wrote:
I might be able to help, but you need more to your code to prevent an.
endless loop.
For starters... to get you out of error mode, here is the fixes for what you
have posted.
Range("7:7").Select 'Set range to start point
Do
While ActiveCell.Value <> ""
With Selection.Interior.ColorIndex = 35
End With ' to end the With loop
ActiveRange.Offset(6, 0).Select
Wend ' to end the While loop
Loop
... but this creates an endless loop. You need something inside your WHILE
loop to offset this endless state. What exactly are you trying to
accomplish? Do you want all rows on each *** to color 35? Or do you want
just row 7 on each *** to color 35? Please explain in further detail.
Mark Ivey
"Kirsty" <Kirsty@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:534333B8-A0DC-41A7-817A-D9EABBF47F81@xxxxxxxxxxxxxxxx
Hi,
I am trying to write a macro that will loop through my spread*** 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
- Follow-Ups:
- Re: Loop macro error
- From: Mark Ivey
- Re: Loop macro error
- References:
- Re: Loop macro error
- From: Mark Ivey
- Re: Loop macro error
- Prev by Date: Re: Copy Named Range from one *** to another with formatting
- Next by Date: Error on Set Rng statement?
- Previous by thread: Re: Loop macro error
- Next by thread: Re: Loop macro error
- Index(es):