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! |
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! |
All times are GMT +1. The time now is 09:33 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com