ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select rows & copy into a different sheet (https://www.excelbanter.com/excel-programming/425054-select-rows-copy-into-different-sheet.html)

Steve[_16_]

select rows & copy into a different sheet
 
I need help coding a procedure which will display an input box allow
me to select various rows to copy from sheet("Condensed") and place
them after the last row containing data in sheet("Expanded"). The
catch is I need to copy each row in the selection 10 times before
copying the next row in the selection. Does anyone have any ideas on
how to code this?

Thanks in advance for any assistance...

JPS[_2_]

select rows & copy into a different sheet
 
Sub aa()

Dim myRange As Range
Dim i As Long
Dim wksto As Worksheet
Set wksto = ThisWorkbook.Sheets("Expanded")
Set myRange = Application.InputBox("Select data to copy", , , , , , , 8)

For i = 1 To myRange.Rows.Count
myRange.Rows(i).EntireRow.Copy wksto.Cells(wksto.Rows.Count,
1).End(xlUp).Offset(1, 0).Resize(10, myRange.Columns.Count)
Next
Application.CutCopyMode = False
End Sub



"Steve" wrote in message
...
I need help coding a procedure which will display an input box allow
me to select various rows to copy from sheet("Condensed") and place
them after the last row containing data in sheet("Expanded"). The
catch is I need to copy each row in the selection 10 times before
copying the next row in the selection. Does anyone have any ideas on
how to code this?

Thanks in advance for any assistance...




JPS[_2_]

select rows & copy into a different sheet
 
revised

Sub aa()

Dim myRange As Range
Dim i As Long
Dim wksto As Worksheet
Set wksto = ThisWorkbook.Sheets("Expanded")
Set myRange = Application.InputBox("Select data to copy", , , , , , , 8)

For i = 1 To myRange.Rows.Count
myRange.Rows(i).EntireRow.Copy wksto.Cells(wksto.Rows.Count,
1).End(xlUp).Offset(1, 0).Resize(10, wksto.Columns.Count)
Next
Application.CutCopyMode = False
End Sub



"Steve" wrote in message
...
I need help coding a procedure which will display an input box allow
me to select various rows to copy from sheet("Condensed") and place
them after the last row containing data in sheet("Expanded"). The
catch is I need to copy each row in the selection 10 times before
copying the next row in the selection. Does anyone have any ideas on
how to code this?

Thanks in advance for any assistance...





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

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