Macro - Insert 4 rows, then go to the next cell and repeat

cjc155

Board Regular
Joined
Apr 21, 2005
Messages
70
Hi,

I have a list of sells that is poviding, for simiplicity sake, the Following
Col A - Company Name
Col B = Start of year (e.g. 1/1/2007 or 1/1/208)
Col C = End of Year (e.g. 12/31/2007 or 12/31/2008)
Col D = Revenue for the year

This goes on for a good 1500 rows. What I am trying to do is write, what I am sure, is a very simple macro that says

Start at A1 - Insert 4 rows, go down to the next row and do the same.

I have this which is

Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.EntireRow.Insert
Selection.End(xlDown).Select

Just want to know how I then tell it to go down one more cell and insert another 4 columns and then stop at cell 1500
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Re: Macro - Insert 4 rows, then go to the next sell and repeat

You'll be better off Starting at the bottom (row 1500 or so) and go up...

Try

Code:
Dim i As Long, lr As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
For i = lr To 1 Step -1
    Cells(i, "A").Resize(4, 1).EntireRow.Insert
Next i
 
Upvote 0
Re: Macro - Insert 4 rows, then go to the next sell and repeat

perfect. Huge thanks for the quick turnaround!
 
Upvote 0
One added question - if I then want to start at the bottom - Select Columns A - C and then paste that value in the 4 rows that I just created?

Again, thanks so much.
 
Upvote 0

Forum statistics

Threads
1,215,762
Messages
6,126,737
Members
449,334
Latest member
moses007

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