Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
do loop until empty cell | Excel Programming | |||
Loop until cell is empty | Excel Programming | |||
Loop to find next empty cell to the right not working. | Excel Programming | |||
Loop all sheetsand delete empty rows | Excel Programming | |||
Empty cells in For Loop | Excel Programming |