• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Add rows automatically

abhi2611

Member
Hi,

Is there a way to automatically add rows between two numbers

Eg:
Current Scenario
1 A
2 B
3 C
4 D
5 E

Required Output
1 A
2
3
4 B
5
6
7 C
8
9
10 E
.......

Any help is appreciated.

Thanks!
 
Hi,

You could run this small macro. At the start of the code you may need to change the column, the first row with data and the number of rows to insert where indicated.

Code:
Sub InsertRows()
Dim MyColumn As String, x As Long
Dim FirstRow As Long, InsertRows As Long
'Column To insert rows
MyColumn = "A"
'First Row of data
FirstRow = 1
'Rows to insert
InsertRows = 2
For x = Cells(Rows.Count, MyColumn).End(xlUp).Row To FirstRow + 1 Step -1
  Rows(x).Resize(InsertRows).Insert
Next x
End Sub
 
Back
Top