LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default COPY MULTIPLE ROWS INSERTED BELOW EACH

Thankyou, hopefully someone can also help with the multiple selections.

"Sheeloo" wrote:

For this to work on selection

replace the line
lastRow = ActiveSheet.Cells(65536, "A").End(xlUp).Row

with
lastRow = Selection.Rows.Count

Someone may help you with the code for multiple selection

"Justaddcat" wrote:

Thankyou, this works very well to copy down every row, which will be helful
some somes. Is there a way to do this but only copy down selected rows? and
in multiple selections?
eg. 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9...
Thankyou again.

"Sheeloo" wrote:

Try the macro
(to run open the worksheet you want it to run on, press Alt-F11, choose
Insert-Module, paste the code below, press F5)
Sub insertrows()
Dim i, lastRow As Long

Application.ScreenUpdating = False

lastRow = ActiveSheet.Cells(65536, "A").End(xlUp).Row
Rows(lastRow + 1).Select
For i = lastRow To 1 Step -1
ActiveCell.EntireRow.Insert
ActiveCell.Offset(-1, 0).EntireRow.Copy Destination:=ActiveCell
Rows(i).Select
Next

Application.ScreenUpdating = True
End Sub

"Justaddcat" wrote:

How can I copy all selected rows to insert each directly below without
individually copying then inserted each row one at a time?
Essentally I need ROW 1, 1, 2, 2, 3, 3, 4, 4, etc.? (I know the rows will
be in numerical order)
Thanks.

 
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
Copy Multiple Rows Excel Bronwyn Excel Discussion (Misc queries) 1 October 4th 07 03:44 AM
how do i copy and inserted drawing object in a cell to multiple ce BROCK8292 Excel Discussion (Misc queries) 1 February 20th 07 09:11 PM
Automatically copy formulas/functions to inserted rows. Barbara Excel Worksheet Functions 7 February 2nd 07 11:40 PM
Copy Multiple Rows into One Cell fijiflyer Excel Discussion (Misc queries) 3 December 13th 06 05:49 PM
How to have formulas and formats auto copy to new inserted rows DippyDawg Excel Discussion (Misc queries) 2 August 5th 05 03:09 PM


All times are GMT +1. The time now is 12:08 AM.

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

About Us

"It's about Microsoft Excel"