PC Review


Reply
Thread Tools Rate Thread

Do Until empty loop

 
 
Kirsty
Guest
Posts: n/a
 
      4th Mar 2008
All,

I have been trying to write a loop macro that will insert a star every 6
rows in column C until there are no values in column B.

So far I can get it to insert only the first star, know I am missing
something but not sure what. This is what I have

Range("B7").Select 'Set range to start point
Do While ActiveCell.Value <> ""
ActiveCell.Offset(0, 1).FormulaR1C1 = "*"
ActiveCell.Offset(1, -1).Select
Loop

Kirsty



 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      4th Mar 2008
You can insert this into your code by removing the first and last lines.

Sub sixrowtest()
lastRow = Cells(Rows.Count, 2).End(xlUp).Row
For i = 7 To lastRow Step 8
If Cells(i, 2) <> "" Then
Cells(i, 3) = "*"
End If
Next
End Sub


"Kirsty" wrote:

> All,
>
> I have been trying to write a loop macro that will insert a star every 6
> rows in column C until there are no values in column B.
>
> So far I can get it to insert only the first star, know I am missing
> something but not sure what. This is what I have
>
> Range("B7").Select 'Set range to start point
> Do While ActiveCell.Value <> ""
> ActiveCell.Offset(0, 1).FormulaR1C1 = "*"
> ActiveCell.Offset(1, -1).Select
> Loop
>
> Kirsty
>
>
>

 
Reply With Quote
 
Kirsty
Guest
Posts: n/a
 
      5th Mar 2008
Thanks,

Works perfectly

"JLGWhiz" wrote:

> You can insert this into your code by removing the first and last lines.
>
> Sub sixrowtest()
> lastRow = Cells(Rows.Count, 2).End(xlUp).Row
> For i = 7 To lastRow Step 8
> If Cells(i, 2) <> "" Then
> Cells(i, 3) = "*"
> End If
> Next
> End Sub
>
>
> "Kirsty" wrote:
>
> > All,
> >
> > I have been trying to write a loop macro that will insert a star every 6
> > rows in column C until there are no values in column B.
> >
> > So far I can get it to insert only the first star, know I am missing
> > something but not sure what. This is what I have
> >
> > Range("B7").Select 'Set range to start point
> > Do While ActiveCell.Value <> ""
> > ActiveCell.Offset(0, 1).FormulaR1C1 = "*"
> > ActiveCell.Offset(1, -1).Select
> > Loop
> >
> > Kirsty
> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why won't my loop recognize empty cells? Jayne22 Microsoft Excel Programming 8 13th Aug 2008 07:53 PM
do loop until empty cell Helmut Microsoft Excel Programming 2 8th Jan 2008 02:11 PM
Loop until cell is empty Ricky Pang Microsoft Excel Programming 6 12th May 2006 05:14 PM
Loop all sheetsand delete empty rows Sige Microsoft Excel Programming 2 27th Jul 2005 12:22 PM
Empty cells in For Loop =?Utf-8?B?TGlua2luZyB0byBzcGVjaWZpYyBjZWxscyBpbiBw Microsoft Excel Programming 2 16th May 2005 07:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:42 PM.