How To Insert Multiple Blank Rows in Excel
On November 10,2022 by Tom RoutleyCreating a macro in Microsoft Excel offers users the ability to automate repetitive and predictable tasks in the program, often saving hours of time.
Insert Blank Rows Between Data Entries
If you would like to create a macro that will insert 2 blank rows into an existing spreadsheet after every 2 data entries, there is an available macro that can help you do so. The end result should look like this:
Default layout:
Title1
Title2
Title3
Title4
After Macro:
Title1
Title2
Title3
Title4
Inserting Multiple Blank Rows Between Existing Data
Utilizing the following macro will get you the result pictured above:
Sub test()
Dim j As Long, r As Range
j = InputBox("type the number of rows to be insered")
Set r = Range("A2")
Do
Range(r.Offset(1, 0), r.Offset(j, 0)).EntireRow.Insert
Set r = Cells(r.Row + j + 1, 1)
'MsgBox r.Address(the apostrophe in the beginning of this line makes this line non operable)
If r.Offset(1, 0) = "" Then Exit Do
Loop
End Sub
Article Recommendations
Latest articles
Popular Articles
Archives
- November 2024
- October 2024
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- October 2023
- September 2023
- August 2023
- July 2023
- June 2023
- May 2023
- April 2023
- March 2023
- February 2023
- January 2023
- December 2022
- November 2022
- October 2022
- September 2022
- August 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- July 2021
- January 2021
Leave a Reply