Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Do Until empty loop

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Do Until empty loop

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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Do Until empty loop

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
do loop until empty cell Helmut Excel Programming 2 January 8th 08 02:11 PM
Loop until cell is empty Ricky Pang Excel Programming 6 May 12th 06 05:14 PM
Loop to find next empty cell to the right not working. Casey[_84_] Excel Programming 3 May 4th 06 03:16 PM
Loop all sheetsand delete empty rows Sige Excel Programming 2 July 27th 05 12:22 PM
Empty cells in For Loop Linking to specific cells in pivot table Excel Programming 2 May 16th 05 07:25 PM


All times are GMT +1. The time now is 10:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"