Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop to insert rows
I need code for a loop that will insert a row (above) then go to the next row
and insert a row. I have code to insert rows however, I get into an infinite loop. Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop to insert rows
This might be what your looking for
Sub InsertRows() Dim cRows As Long Dim i As Integer For i = Cells(Rows.Count, "A").End(xlUp).row To 2 Step -1 If Cells(i, "A") < "" And Cells(i - 1, "A") < "" Then Cells(i, "A").EntireRow.Insert End If Next i End Sub "Fergie" wrote: I need code for a loop that will insert a row (above) then go to the next row and insert a row. I have code to insert rows however, I get into an infinite loop. Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Loop relative rows | Excel Discussion (Misc queries) | |||
Insert Variable Number of Rows; With Loop | Excel Worksheet Functions | |||
Cannot loop through rows in C# | Excel Programming | |||
Cant run insert row through loop | Excel Programming | |||
help on insert rows and fill down loop until end | Excel Programming |