ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pasting selection to end of workbook? (https://www.excelbanter.com/excel-programming/275488-pasting-selection-end-workbook.html)

joshashcraft

pasting selection to end of workbook?
 
Here is what i am attempting to do. i have a range of
cells in a column that i am copying, switching to a
different open workbook, and pasting at the end of the
column.
ex. cells a5:a50 are getting copied and pasted to a
different workbook at the end of column b
Any help would be much appreciated!
thanks in advance,
Josh

Bob Tulk

pasting selection to end of workbook?
 
Assuming the range you want to copy is already selected...

Selection.Copy
Sheets("Sheet2").Select 'Or whatever sheet name you have
Range("B1").select 'Or the first cell of the column you
want to find the end of.

'This takes us to the last cell of the column
Selection.End(xlDown).Select

'Need to go down one more cell so we don't overwrite the
last cell of data
ActiveCell.Offset(1, 0).Range("A1").Select

'Paste what we copied
ActiveSheet.Paste

-----Original Message-----
Here is what i am attempting to do. i have a range of
cells in a column that i am copying, switching to a
different open workbook, and pasting at the end of the
column.
ex. cells a5:a50 are getting copied and pasted to a
different workbook at the end of column b
Any help would be much appreciated!
thanks in advance,
Josh
.



All times are GMT +1. The time now is 12:56 PM.

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