How to insert specific number of rows at fixed intervals in Excel?
In Excel worksheet, you can insert a blank row between existing rows by using Insert function. But, if you have a large range of data, and, you need to insert two blank rows after every third ot nth row, how could you finish this job quickly and conveniently?
- Insert specific number of blank rows into data range at fixed intervals with VBA code
- Insert specific number of blank rows into data range based on cell values with VBA code
- Insert specific number of blank rows into data range at fixed intervals with a handy feature
- Copy and insert rows multiple times based on specific numbers with VBA code
- Copy and insert rows multiple times based on specific numbers with an amazing feature
Insert specific number of blank rows into data range at fixed intervals with VBA code
The following VBA code can help you to insert a specific number of rows after every nth row within existing data. Please do as follows:
1. Hold down the ALT + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Insert specific number of rows into data at fixed intervals
Sub InsertRowsAtIntervals()
'Updateby Extendoffice
Dim Rng As Range
Dim xInterval As Integer
Dim xRows As Integer
Dim xRowsCount As Integer
Dim xNum1 As Integer
Dim xNum2 As Integer
Dim WorkRng As Range
Dim xWs As Worksheet
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xRowsCount = WorkRng.Rows.Count
xInterval = Application.InputBox("Enter row interval. ", xTitleId, 1, Type:=1)
xRows = Application.InputBox("How many rows to insert at each interval? ", xTitleId, 1, Type:=1)
xNum1 = WorkRng.Row + xInterval
xNum2 = xRows + xInterval
Set xWs = WorkRng.Parent
For i = 1 To Int(xRowsCount / xInterval)
xWs.Range(xWs.Cells(xNum1, WorkRng.Column), xWs.Cells(xNum1 + xRows - 1, WorkRng.Column)).Select
Application.Selection.EntireRow.Insert
xNum1 = xNum1 + xNum2
Next
End Sub
3. After pasting this code, please press F5 key to run this code, a prompt box will pop out to remind you selecting the data range that you want to insert blank rows, see screenshot:
4. Click OK button, another prompt box will pop out, please enter the number of row intervals, see screenshot:
5. Go on clicking OK button, in the following popped out prompt box, please enter the number of blank rows that you want to insert, see screenshot:
6. Then click OK, and the blank rows have been inserted into the existing data at a regular intervals, see screenshots:
![]() |
![]() |
![]() |
Insert specific number of blank rows into data range based on cell values with VBA code
Sometimes, you may need to insert the blank rows based on a list of cell values, in this case, the below VBA code can do you a favor, please do as this:
1. Hold down the ALT + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Insert specific number of blank rows based on a list of numbers:
Sub Insertblankrowsbynumbers ()
'UpdatebyExtendoffice
Dim xRg As Range
Dim xAddress As String
Dim I, xNum, xLastRow, xFstRow, xCol, xCount As Long
On Error Resume Next
xAddress = ActiveWindow.RangeSelection.Address
Set xRg = Application.InputBox("Select the spefic number column to use(single column):", "Kutools For Excel", xAddress, , , , , 8)
If xRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
xLastRow = xRg(1).End(xlDown).Row
xFstRow = xRg.Row
xCol = xRg.Column
xCount = xRg.Count
Set xRg = xRg(1)
For I = xLastRow To xFstRow Step -1
xNum = Cells(I, xCol)
If IsNumeric(xNum) And xNum > 0 Then
Rows(I + 1).Resize(xNum).Insert
xCount = xCount + xNum
End If
Next
xRg.Resize(xCount, 1).Select
Application.ScreenUpdating = True
End Sub
3. After pasting this code, press F5 key to run this code, in the popped out dialog box, select the list of numbers that you want to insert blank rows based on, see screenshot:
4. Then, click OK, and you will get the results you need as following screenshots shown:
![]() |
![]() |
![]() |
Insert specific number of blank rows into data range at fixed intervals with a handy feature
If you are not familiar with above VBA code, Kutools for Excel also may help you, its Insert Blank Rows & Columns feature can insert specific number of rows or columns into existing data at fixed intervals quickly and easily.
After installing Kutools for Excel, please do as follows:
1. Select the data range that you want to insert blank rows at intervals.
2. Click Kutools > Insert > Insert Blank Rows & Columns, see screenshot:
3. In the Insert Blank Row & Columns dialog box, choose Blank rows option from the Insert type, and then specify the number of interval and blank rows that you want to use as following screenshot shown:
4. Then click OK button, and the blank rows have been inserted into the selected range at a specific interval as following screenshot shown:
![]() |
![]() |
![]() |
Download and free trial Kutools for Excel Now !
Copy and insert rows multiple times based on specific numbers with VBA code
Supposing, you have a range of tada, and now, you want to copy each row and paste them multiple times to the next row based on a list of numbers as below screenshots shown. How could solve this task in Excel worksheet?
![]() |
![]() |
![]() |
To deal with this job, I will introduce a useful code for you, please do with the following steps:
1. Hold down the ALT + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Copy and insert rows multiple times based on specific numbers:
Sub CopyRows()
'UpdatebyExtendoffice
Dim xRg As Range
Dim xCRg As Range
Dim xFNum As Integer
Dim xRN As Integer
On Error Resume Next
SelectRange:
xTxt = ActiveWindow.RangeSelection.Address
Set xRg = Application.InputBox("Select the list of numbers to copy the rows based on: ", "Kutools for Excel", xTxt, , , , , 8)
If xRg Is Nothing Then Exit Sub
If xRg.Columns.Count > 1 Then
MsgBox "Please select single column!"
GoTo SelectRange
End If
Application.ScreenUpdating = False
For xFNum = xRg.Count To 1 Step -1
Set xCRg = xRg.Item(xFNum)
xRN = CInt(xCRg.Value)
With Rows(xCRg.Row)
.Copy
.Resize(xRN).Insert
End With
Next
Application.ScreenUpdating = True
End Sub
3. After pasting this code, press F5 key to run this code, in the popped out dialog box, select the list of numbers that you want to copy and insert the data rows based on, see screenshot:
4. Then, click OK button, and the specific number of rows have been copy and paste under each original row, see screenshots:
![]() |
![]() |
![]() |
Copy and insert rows multiple times based on specific numbers with an amazing feature
If you have Kutools for Excel, with its Duplicate Rows / Columns based on cell value feature, you can insert the rows or columns based on the list of numbers quickly and easily.
After installing Kutools for Excel, please do as follows:
1. Click Kutools > Insert > Duplicate Rows / Columns based on cell value, see screenshot:
2. In the Copy and insert rows & columns dialog box, select Copy and insert rows option in the Type section, then select the data range you want to duplicate, and then specify the list of values that you want to copy rows based on, see screenshot:
4. Then, click Ok or Apply button, you will get the following result as you need:
![]() |
![]() |
![]() |
Download and free trial Kutools for Excel Now !
More relative articles:
- Copy And Insert Row Multiple Times Or Duplicate The Row X Times
- In your daily work, have you ever tried to copy a row or each row and then insert multiple times below the current data row in a worksheet? For example, I have a range of cells, now, I want to copy each row and paste them 3 times to the next row as following screenshot shown. How could you deal with this job in Excel?
- Insert Blank Rows When Value Changes In Excel
- Supposing you have a range of data, and now you want to insert blank rows between the data when value changes, so that you can separate the sequential same values in one column as following screenshots shown. In this article, I will talk about some tricks for you to solve this problem.
- Insert A Blank Row After Specific Text In Excel
- If you want to insert blank rows after a specific text as following screenshot shown, how to deal with it quickly and easily without inserting them manually one by one?
- Copy Rows From Multiple Worksheets Based On Criteria Into A New Sheet
- Supposing, you have a workbook with three worksheets which have the same formatting as below screenshot shown. Now, you want to copy all the rows from these worksheets which column C contain the text “Completed” into a new worksheet. How could you solve this problem quickly and easily without copying and pasting them one by one manually?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!















