Inserting blank rows between data rows (mutliple at one time)

D

DP

Hello,
I have a Ecel data file which includes 10,000 rows of
data (inventory). I need to insert a blank row between
each data row. I now how to do the insert function but
this would only insert one blank row at a time. Help!!
 
C

Chip Pearson

DP

Try a macro like the following:

Sub InsertRows()
Dim RowNdx As Long
For RowNdx = 2 To LastRow * 2 Step 2
Rows(RowNdx).Insert
Next RowNdx
End Sub

Change LastRow to the last row of your data.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
E

Earl Kiosterud

DP,

Consider this carefully. If you plan to use two rows per item, or something
like that, where you deviate from a classic database "one row per item"
table, you'll not be able to use much Excel functionality (Pivot tables,
some sorts, Subtotals, Autofilters, etc. etc). Lookups mey be confounded
too. Try to put all the information about any item into a field in its
record, and keep to one record per item.
 

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