ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I insert 20 rows between each row of text? (https://www.excelbanter.com/excel-discussion-misc-queries/129012-how-do-i-insert-20-rows-between-each-row-text.html)

PaigeinFL

How do I insert 20 rows between each row of text?
 
I have a two column list of 265 names. I want to insert 20 blank rows between
each name. Is there some easy way to do this? Seems like an easy and somewhat
stupid question. Sorry!

Gord Dibben

How do I insert 20 rows between each row of text?
 
Sub InsertRows()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim r As Long
numRows = 20
For r = 265 To 1 Step -1
ActiveSheet.Rows(r + 1).Resize(numRows).EntireRow.Insert
Next r
Application.ScreenUpdating = True
End Sub

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP

On Fri, 2 Feb 2007 14:28:00 -0800, PaigeinFL
wrote:

I have a two column list of 265 names. I want to insert 20 blank rows between
each name. Is there some easy way to do this? Seems like an easy and somewhat
stupid question. Sorry!



Herbert Seidenberg

How do I insert 20 rows between each row of text?
 
If you can limit yourself to 254 names
and want an easy way without VBA, then go to
Tools Options Custom Lists Import list from cells, and enter
$A$1:$A$254
Enter the name at A1 into C1 and select it and 20 blank cells
below it. Drag the fill handle down to row 5334.



All times are GMT +1. The time now is 05:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com