Thursday, June 3, 2010

Insert n rows after each row in EXCEL

image

image

Sub InsertRows()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim r As Long
r = Cells(Rows.Count, "A").End(xlUp).Row
numRows = 2
For r = r To 1 Step -1
Worksheets(4).Rows(r + 1).Resize(numRows).Insert
Next r
Application.ScreenUpdating = True
End Sub

No comments:

Post a Comment