Insert 5 Rows

M

Matt

I am sure this is an easy one for the MVP's...I need to insert 5 rows after
each rowin a worksheet that has 70 rows. Each Row currently has data, we
need to add data between each row. Also, we need to do this for antoher
sheet that has a different number of rows than 70.
Thanks.
 
B

Bill Kuunders

This could be done with a macro I'm sure but
it can also be done with a helper column and a sort.

Insert a column and number each row with the series 1, 6, 11, 16, 21, 26
etc
just enter the first two 1 and 6 and extend down.
Then enter the series 1 2 3 4 5 6 7 from row 71 onwards
extend it down till you have more than 350

do a sort of the data using this column.
 
R

Rick Rothstein \(MVP - VB\)

I think this macro does what you want...

Sub InsertFiveRows()
Dim X As Long, Z As Long
On Error GoTo FixScreen
Application.ScreenUpdating = False
With ActiveSheet
For X = .Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
For Z = 0 To 4
.Cells(X + Z, 1).EntireRow.Insert xlShiftDown
Next
Next
End With
FixScreen:
Application.ScreenUpdating = True
End Sub

Rick
 
D

Don Guillett

try this
Sub insertfiverows()
mcc = "a"
For i = Cells(Rows.count, mcc).End(xlUp).Row To 2 Step -1
Cells(i, mcc).Resize(5).EntireRow.Insert
Next i
End Sub
 
B

Bob I

In a helper column, number down 1-70, then below that 5 more times, now
sort the sheet on that column, you will have data then 5 blank rows. Do
the same with what ever number of rows you have 1-xx.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top