Saturday, April 20, 2019

Insert Multiple Rows


Insert Multiple Rows
Once you run this macro it will show an input box and you need to enter the number of rows you want to insert.\
Note you can also changes the i value on specific number of rows
Sub InsertMultipleRows()
Dim i As Integer
Dim j As Integer
ActiveCell.EntireRow.Select
On Error GoTo Last
i = InputBox("Enter number of columns to insert", "Insert Columns")
For j = 1 To i
Selection.Insert Shift:=xlToDown, CopyOrigin:=xlFormatFromRightorAbove
Next j
Last:Exit Sub
End Sub

No comments:

Post a Comment