Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default INSERTING COPIED ROWS

I need to copy 3 blank rows and insert them in every other row on the sheet.
Is there a way to insert multiple copied cells into multiple locations at one
time? Excel gives me the command cannot be performed with multiple
selections please select a single range error.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default INSERTING COPIED ROWS

You cannot insert at multiple locations as you have found out.

Also you cannot insert three rows after every other row on a sheet.

Excel will squawk about "cannot shift objects off sheet"

You could do it for a range that would not reach to the bottom of the sheet.

Here is a macro to insert 3 blank rows every second row 1000 times.

Sub InsertRows()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim r As Long
numRows = 3
For r = 1000 To 1 Step -2
ActiveSheet.Rows(r + 1).Resize(numRows).EntireRow.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 Wed, 5 Mar 2008 14:55:01 -0800, rgodchaux
wrote:

I need to copy 3 blank rows and insert them in every other row on the sheet.
Is there a way to insert multiple copied cells into multiple locations at one
time? Excel gives me the command cannot be performed with multiple
selections please select a single range error.


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
Please help - Inserting copied cells question [email protected] Excel Discussion (Misc queries) 3 June 30th 07 10:15 PM
Inserting Blank rows after every row upto 2500 rows Manju Excel Worksheet Functions 8 August 22nd 06 12:54 PM
blank rows between copied rows Arif Excel Discussion (Misc queries) 2 May 5th 06 12:18 PM
Inserting Rows IanW Excel Discussion (Misc queries) 4 February 19th 06 08:26 PM
Inserting Copied Row To Always Insert Above Sub Total Jamess Excel Worksheet Functions 0 November 9th 05 11:09 PM


All times are GMT +1. The time now is 08:39 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"