Try this code:
Private Sub CommandButton1_Click()
Dim iRow As Long, a
Dim iCount As Long
Dim cRow As Long
Dim i As Long
Application.ScreenUpdating = False
iCount = InputBox(Prompt:="How many rows you want to add?")
iRow = InputBox _
(Prompt:="After which row you want to add new rows? (Enter the row number")
cRow = InputBox(Prompt:="Which row you need to copy? (Enter the row number)")
a = Rows(cRow)
For i = iRow To iCount + iRow - 1
Rows(i).EntireRow.Insert
Rows(i) = a
Next i
Application.ScreenUpdating = True
End Sub
Note: Forum rules require you add code tags to posted code (You can do so by highlighting the code and pressing the # in the edit bar)
Bookmarks