0
Thanks

A few words of thanks would be greatly appreciated.

How To Insert Multiple Blank Rows in Excel


Creating 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
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Related

This document, titled « How To Insert Multiple Blank Rows in Excel », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).