1
Thanks

A few words of thanks would be greatly appreciated.

Macro to Insert Blank Rows In Excel

You're trying to create a macro that will insert a set of blank rows into an existing spreadsheet after each entry. The amount of needed rows will be the same for each entry of the spreadsheet, but will need to be changed each time it is used. Follow the guide below.




Example of How to Insert Blank Rows in Excel

The following is a sample:
Currently:
Title1  
Title2
Title3
Title4


After using Macro:

Title1  


Title2


Title3


Title4


The amount of blank row can go from 20 - 40.

Method to Insert Black Rows in Excel

A1 is having headings.
Then try this macro
keep your original file safely somewhere
first do the testing of macro in the experimental data you have sent
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
If r.Offset(1, 0) = "" Then Exit Do
Loop

End Sub



Image: © 123RF.com
1
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 « Macro to Insert 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).

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!