Inserting rows in VBA Excel
33,195
Try below code
Sub InsertRow()
Dim lastRow As Long
lastRow = Range("A" & Rows.Count).End(xlUp).Row
For i = lastRow To 3 Step -1
Cells(i, 1).Resize(4).Insert Shift:=xlDown
Next
End Sub
Author by
user20159
Updated on November 01, 2020Comments
-
user20159 over 3 years
does anyone know how to insert 4 rows after each row, from row 2 to row 5? Of course using Excel VBA. I attach a picture to explain it better.
Any hints will be really appreciated. Regards!
-
Santosh over 10 years@user20159 Welcome :)