Insert row after every two rows

Jillbeirne

New Member
Joined
Sep 17, 2003
Messages
7
...beginning with A4. This would save me so much time if i had a macro that could do this! I dont know how to edit the macro i have that inserts a row after every row to perform this new task.

Any thoughts! this message board is the BEST!

thanks to all..

-J
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try this

Modify as needed

Sub InsertIT()

x = 4 'Start Row

Do

Range("A" & x).Insert
x = x + 3

Loop While x < 1000 'change for more inserted rows

End Sub
 
Upvote 0
Hi Jillbeirne:

The following macro will insert a row every secod row -- that is it will insert a row above row4, then row6, then row8, and so on till row16 ...
Code:
Sub yTest01()
    For i = 4 To 16 Step 2
        Cells(i, 1).EntireRow.Insert
    Next i
End Sub
Is this what you are looking for? If your requirements are different, please post back and then let us take it from there.
 
Upvote 0
Thanks for the help! DRJ, was wondering how to insert rows instead of just insert cells after every two; its seems only to be inserting breaks in column A! Thanks so much,

-Jill
 
Upvote 0
Hi Jill:

Try the following ...
Code:
Sub yTest01()
    j = 0
    For i = 4 To 16 Step 2
        j = j + 1
        Cells(i + j, 1).EntireRow.Insert
    Next i
End Sub
The above macro will insert a row starting with the 5th row and then insert another row after every two rows. Please post back if it works for you now -- or explain a little further and then let us take it from there.
 
Upvote 0
Hi,

I ran into this old threat and it is something I need a lit bit of help. I'm looking to insert a row after every two roads for the entire sheet. When I run the macro it inserts the rows until row 22. How can I modify it to insert a row after every other two for the entire data?

Thanks in advance - LM
 
Upvote 0

Forum statistics

Threads
1,215,425
Messages
6,124,824
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top