Thread: Inserting rows
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
scotty scotty is offline
external usenet poster
 
Posts: 45
Default Inserting rows

If I wanted to insert 5 rows for every 1 row. How would I change the below
macro?

Thanks

"JW" wrote:

Starting at which row? You can tweak something like this to your
needs.
Sub foo()
Dim n As Long
n = 6
botrow = Cells(Rows.Count, 1).End(xlUp).Row
Do Until n = botrow
Range("A1").Offset(n, 0).EntireRow.Insert
n = n + 6
botrow = botrow + 1
Loop
End Sub

Scotty wrote:
I need a macro to insert two rows at every 6th row.

Thank you.