ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy range from one workbook to another (https://www.excelbanter.com/excel-programming/401633-copy-range-one-workbook-another.html)

Chad[_3_]

Copy range from one workbook to another
 
Hi All,

I am trying to copy a range from one workbook to another. Other posts say
you cannot copy from an inactive worksheet, but when I copy to the
clipboard, open or activate the other workbook, it fails.

Workbooks("349999M.xls").Worksheets("Sheet1").Rang e("A1:E14").Copy
Workbooks.Open "\\Server1\BellPit.xls", False
ActiveWorkbook.Worksheets(1).Activate
Cells(1, 1).Activate
ActiveSheet.Paste

Any help would be great,
Thanks
Chad



JLGWhiz

Copy range from one workbook to another
 
Workbooks("349999M.xls").Worksheets("Sheet1").Rang e("A1:E14").Copy
Workbooks.Open "\\Server1\BellPit.xls", False
Workbooks("Bellpit").Worksheets(1).Cells(1, 1).Paste

"Chad" wrote:

Hi All,

I am trying to copy a range from one workbook to another. Other posts say
you cannot copy from an inactive worksheet, but when I copy to the
clipboard, open or activate the other workbook, it fails.

Workbooks("349999M.xls").Worksheets("Sheet1").Rang e("A1:E14").Copy
Workbooks.Open "\\Server1\BellPit.xls", False
ActiveWorkbook.Worksheets(1).Activate
Cells(1, 1).Activate
ActiveSheet.Paste

Any help would be great,
Thanks
Chad




JLGWhiz

Copy range from one workbook to another
 
Better yet:
Workbooks.Open "\\Server1\BellPit.xls", False
Workbooks("349999M.xls").Worksheets("Sheet1").Rang e("A1:E14").Copy
Destination:=Workbooks("Bellpit").Worksheets(1).Ce lls(1, 1)


"Chad" wrote:

Hi All,

I am trying to copy a range from one workbook to another. Other posts say
you cannot copy from an inactive worksheet, but when I copy to the
clipboard, open or activate the other workbook, it fails.

Workbooks("349999M.xls").Worksheets("Sheet1").Rang e("A1:E14").Copy
Workbooks.Open "\\Server1\BellPit.xls", False
ActiveWorkbook.Worksheets(1).Activate
Cells(1, 1).Activate
ActiveSheet.Paste

Any help would be great,
Thanks
Chad




Chad Cameron

Copy range from one workbook to another
 
Sorry, for the delay,

Thanks
Chad
"JLGWhiz" wrote in message
...
Better yet:
Workbooks.Open "\\Server1\BellPit.xls", False
Workbooks("349999M.xls").Worksheets("Sheet1").Rang e("A1:E14").Copy
Destination:=Workbooks("Bellpit").Worksheets(1).Ce lls(1, 1)


"Chad" wrote:

Hi All,

I am trying to copy a range from one workbook to another. Other posts
say
you cannot copy from an inactive worksheet, but when I copy to the
clipboard, open or activate the other workbook, it fails.

Workbooks("349999M.xls").Worksheets("Sheet1").Rang e("A1:E14").Copy
Workbooks.Open "\\Server1\BellPit.xls", False
ActiveWorkbook.Worksheets(1).Activate
Cells(1, 1).Activate
ActiveSheet.Paste

Any help would be great,
Thanks
Chad






Chad Cameron[_4_]

Copy range from one workbook to another
 
Actually it didn't work

Here is my code

Workbook 07125M.xls is already open and active when the following code is
executed. The error is "Subscript is out of range"

Workbooks.Open "\\Server1\Data\Engineering\Highwall
Monitors\SLOPE_MONITORING_1XX_BellPit.xls", False
Workbooks("07125M").Worksheets("Sheet1").Range("A1 :E16").Copy
Destination:=Workbooks("SLOPE_MONITORING_1XX_BellP it").Worksheets(1).Cells(1,
1)




All times are GMT +1. The time now is 03:34 AM.

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