Normally, there is not a good method for copying and inserting rows multiple times except dealing with manually copy and insert. Then click OK button, and three new copied rows have been inserted below the selected row, see screenshot:Ĭopy and insert each row multiple times based on a specific number easily After pasting the code, please press F5 key to run this code, and a prompt box is popped out to remind you to enter the number of times that you want to duplicate, see screenshot:Ĥ. Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(xCount, 0)).EntireRow.Insert Shift:=xlDownģ. MsgBox "the entered number of rows is error, please enter again", vbInformation, "Kutools for Excel" XCount = Application.InputBox("Number of Rows", "Kutools for Excel",, ,, ,, 1) VBA code: Duplicate one specific row multiple times: Sub test()
#How do i number each row in a word table individually code
Click Insert > Module, and paste the following code in the Module Window. Specify a row which you want to copy and insert multiple times, and then hold down the ALT + F11 keys, then it opens the Microsoft Visual Basic for Applications window.Ģ. If you want to duplicate only one specific row x times, the following VBA code may help you, please do as this:ġ.