Help!

Inserting blank rows in Excel.

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Excel General (archive) RSS
Next:  How can I create Combo list with no VBA  
Author Message
kwm5321
External


Since: Nov 04, 2005
Posts: 1



PostPosted: Fri Nov 04, 2005 4:12 pm    Post subject: Inserting blank rows in Excel.
Archived from groups: microsoft>public>excel>misc (more info?)

In Excel, is it possible to insert a 'blank' (new) row between each row of
exisitng text?
Back to top
Chip Pearson
External


Since: Aug 31, 2003
Posts: 1213



PostPosted: Fri Nov 04, 2005 6:23 pm    Post subject: Re: Inserting blank rows in Excel. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Try the following VBA macro:

Sub InsertRows()
Dim RowNdx As Long
Dim LastRow As Long

LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For RowNdx = LastRow To 2 Step -1
Rows(RowNdx).Insert
Next RowNdx

End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"kwm5321" wrote in message

> In Excel, is it possible to insert a 'blank' (new) row between
> each row of
> exisitng text?
Back to top
deeds
External


Since: Jun 09, 2006
Posts: 18



PostPosted: Thu Nov 30, 2006 12:58 pm    Post subject: Re: Inserting blank rows in Excel. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

How do I change it from inserting one row to inserting 11 rows at once?
Thanks.

"Chip Pearson" wrote:

> Try the following VBA macro:
>
> Sub InsertRows()
> Dim RowNdx As Long
> Dim LastRow As Long
>
> LastRow = Cells(Rows.Count, "A").End(xlUp).Row
> For RowNdx = LastRow To 2 Step -1
> Rows(RowNdx).Insert
> Next RowNdx
>
> End Sub
>
>
> --
> Cordially,
> Chip Pearson
> Microsoft MVP - Excel
> Pearson Software Consulting, LLC
> www.cpearson.com
>
>
> "kwm5321" wrote in message
>
> > In Excel, is it possible to insert a 'blank' (new) row between
> > each row of
> > exisitng text?
>
>
>
Back to top
Gord Dibben
External


Since: Feb 23, 2004
Posts: 9431



PostPosted: Thu Nov 30, 2006 9:19 pm    Post subject: Re: Inserting blank rows in Excel. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Try this one.

Sub InsertRows()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim r As Long
r = Cells(Rows.Count, "A").End(xlUp).Row
numRows = 11
For r = r To 1 Step -1
ActiveSheet.Rows(r + 1).Resize(numRows).Insert
Next r
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP


On Thu, 30 Nov 2006 07:58:00 -0800, deeds
wrote:

>How do I change it from inserting one row to inserting 11 rows at once?
>Thanks.
>
>"Chip Pearson" wrote:
>
>> Try the following VBA macro:
>>
>> Sub InsertRows()
>> Dim RowNdx As Long
>> Dim LastRow As Long
>>
>> LastRow = Cells(Rows.Count, "A").End(xlUp).Row
>> For RowNdx = LastRow To 2 Step -1
>> Rows(RowNdx).Insert
>> Next RowNdx
>>
>> End Sub
>>
>>
>> --
>> Cordially,
>> Chip Pearson
>> Microsoft MVP - Excel
>> Pearson Software Consulting, LLC
>> www.cpearson.com
>>
>>
>> "kwm5321" wrote in message
>>
>> > In Excel, is it possible to insert a 'blank' (new) row between
>> > each row of
>> > exisitng text?
>>
>>
>>
Back to top
gwladys



Joined: Mar 06, 2009
Posts: 1



PostPosted: Fri Mar 06, 2009 9:08 pm    Post subject: [Login to view extended thread Info.]

You're making this WAY too complicated. You don't need a macro.

Add a column to the left or right of your data. It doesn't matter where.
In the first cell type 1. In the second cell type 2. Grab both cells and drag to the bottom row of your data. Excel will number your rows as 1,2,3 etc.
While all of this column is highlighted, select copy (Ctrl-C), then go down to the first empty row and hit paste.
Now sort all of your data on that column and you will have empty rows between everything.
If you want to insert more than one row, just paste the copied data that many times.
You can now delete that column as it's no longer necessary.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Excel General (archive) All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum