Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default Inserting several new rows

I have a spreadsheet with about 1500 rows. I want to insert 18 black rows
after each existing row. Is there a quick way of doing this without having
to do this after each row?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Inserting several new rows

That will give you 27,000 rows - are you sure this is what you want to
do? And I presume you meant 18 blank rows rather than black rows?

Pete

On Jan 17, 11:00*pm, richzip
wrote:
I have a spreadsheet with about 1500 rows. *I want to insert 18 black rows
after each existing row. *Is there a quick way of doing this without having
to do this after each row?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Inserting several new rows

Sub Insert_Some_Rows()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim R As Long
numRows = InputBox("Enter number of blank rows to insert")
R = Cells(Rows.Count, "A").End(xlUp).Row
For R = R To 1 Step -1
ActiveSheet.Rows(R + 1).Resize(numRows).Insert
Next R
Application.ScreenUpdating = True
End Sub

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

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

or Ron de De Bruin's site on where to store macros.

http://www.rondebruin.nl/code.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 or edit 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 Thu, 17 Jan 2008 15:00:02 -0800, richzip
wrote:

I have a spreadsheet with about 1500 rows. I want to insert 18 black rows
after each existing row. Is there a quick way of doing this without having
to do this after each row?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
inserting rows Stacie Excel Discussion (Misc queries) 3 February 19th 07 08:25 PM
Inserting Blank rows after every row upto 2500 rows Manju Excel Worksheet Functions 8 August 22nd 06 12:54 PM
Inserting new rows max Excel Worksheet Functions 3 April 22nd 06 06:47 PM
inserting rows at top Les Stockton New Users to Excel 1 January 27th 06 03:22 PM
Inserting rows Aloysicus Excel Discussion (Misc queries) 0 July 26th 05 04:31 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"