Repeat adding rows

basicjohn

New Member
Joined
Aug 9, 2005
Messages
14
Hi All,

I have an excel sheet as follows :
a b
1Supp1 Code1
2Supp2 Code2

This is repeated for 1000 rows. Now question is how do I add 3 empty rows for each supplier line until the end of the supplier line by using Macro ?

Meaning results should be as follows :
a b
1Supp1 Code1
2
3
4
5Supp2 Code2
6
7
8
9Supp3 Code3

Hope to hear from you all soon.

Cheers for now.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Tazguy37

MrExcel MVP
Joined
May 28, 2004
Messages
4,237
Or how about:

Code:
For iRow = Range("A" & Rows.Count).End(xlUp).Row To 2 Step -1
        Rows(iRow).Resize(3).Insert
    Next

Hope that helps!

EDIT: Typo
 

basicjohn

New Member
Joined
Aug 9, 2005
Messages
14
Thank you very much

Noted the tools and it work very well, and also for the macro that was given by Taz was also wonderful....

Keep up the good work guys .... :)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,504
Messages
5,832,106
Members
430,111
Latest member
Francis Xavier

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
Top