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.
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

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 .... :)
 

Watch MrExcel Video

Forum statistics

Threads
1,118,823
Messages
5,574,523
Members
412,601
Latest member
TheBeaniacExpress
Top