Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
COPY MULTIPLE ROWS INSERTED BELOW EACH
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. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
COPY MULTIPLE ROWS INSERTED BELOW EACH
You can select all those cells and COPY
then select any cell you want to copy to and select PASTE | PASTE SPECIAL from the menu In the paste special dialog, check 'Transpose', then <ok Shoud be good to go :-) "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. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
COPY MULTIPLE ROWS INSERTED BELOW EACH
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. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
COPY MULTIPLE ROWS INSERTED BELOW EACH
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. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
COPY MULTIPLE ROWS INSERTED BELOW EACH
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. |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Multiple Rows Excel | Excel Discussion (Misc queries) | |||
how do i copy and inserted drawing object in a cell to multiple ce | Excel Discussion (Misc queries) | |||
Automatically copy formulas/functions to inserted rows. | Excel Worksheet Functions | |||
Copy Multiple Rows into One Cell | Excel Discussion (Misc queries) | |||
How to have formulas and formats auto copy to new inserted rows | Excel Discussion (Misc queries) |