Inserting rows between each entry

  • Thread starter Thread starter Brablo
  • Start date Start date
B

Brablo

I have a thousand lines of data, and there are 5 fields of information
which describes all 1000 lines of data. Another words, I have data from
cell A1:E1000.

I am interested in inserting between each row 5 lines. For example:

Active 24 Hour Fitness Worldwide, Inc. 925-543-3100
Active 99 Cents Only Stores 323-980-8145
Active A And G, Inc 714-765-0400

Should appear as:
Active 24 Hour Fitness Worldwide, Inc. 925-543-3100



Active 99 Cents Only Stores 323-980-8145



Active A And G, Inc 714-765-0400

I know about simply inserting rows into the appropriate place, and
pressing CONTROL Y a few times. However, I'd like to automate this
process.

I've tried recording macros, but this doesn't seem to work. Every time
I execute the macro, only the top line gets "expanded/heightened".
 
You can do it easily with a macro.

Sub InsertRows()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim r As Long
numRows = 5
For r = 1000 To 1 Step -1
ActiveSheet.Rows(r + 1).Resize(numRows).EntireRow.Insert
Next r
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP
 
Brablo,

Are you sure you want to do this? You won't any longer have a standard (1
row per item) table on which Excel can do many operations on (unless you'll
be inserting similar records in the new empty rows). I just have the
feeling you're heading down a road you might find is less travelled for some
good reasons. If this is for printing purposes, have you considered
increasing the row height to get the space you need?
 

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

Back
Top