Inserting Rows

G

Guest

I have a spreadsheet with about 1,000 rows of customer contacts. I need to
insert 4 blank rows between each record for more information (End up being
5,000 rows total). Is there a way to do this automatically without having to
insert row after row in between each record?
 
R

Ron de Bruin

Hi GOL

Try this one

Sub test()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim R As Long
Dim rng As Range
numRows = 4
Set rng = ActiveSheet.UsedRange
For R = rng.Rows.Count To 1 Step -1
rng.Rows(R + 1).Resize(numRows).EntireRow.insert
Next R
Application.ScreenUpdating = True
End Sub
 
G

Guest

THANKS!!!!!!

Ron de Bruin said:
Hi GOL

Try this one

Sub test()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim R As Long
Dim rng As Range
numRows = 4
Set rng = ActiveSheet.UsedRange
For R = rng.Rows.Count To 1 Step -1
rng.Rows(R + 1).Resize(numRows).EntireRow.insert
Next R
Application.ScreenUpdating = True
End Sub
 

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