ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Excel tab (worksheet) to another Excel file (https://www.excelbanter.com/excel-programming/386791-copy-excel-tab-worksheet-another-excel-file.html)

Stefan van der Hooft

Copy Excel tab (worksheet) to another Excel file
 
Hi!

I have a question about Excel tabs (worksheets)

Is there a possibility to copy a tab-page (worksheet) from an Excel file to
another Excel file. I know that it is possible within the same Excel file,
but is it also possible to copy outside this file?

Example:
Sheet X with worksheet ABC DEF GHJ
Sheet Y

I want to copy DEF from worksheet X to sheet Y

Kind regards, Stefan van der Hooft.

Tom Ogilvy

Copy Excel tab (worksheet) to another Excel file
 
With Workbooks("Y.xls")
workbooks("X.xls").Worksheets("DEF").copy After:= _
.Worksheets(.worksheets.count)
End With

as an example. Both workbooks must be open.

--
Regards,
Tom Ogilvy


"Stefan van der Hooft" wrote:

Hi!

I have a question about Excel tabs (worksheets)

Is there a possibility to copy a tab-page (worksheet) from an Excel file to
another Excel file. I know that it is possible within the same Excel file,
but is it also possible to copy outside this file?

Example:
Sheet X with worksheet ABC DEF GHJ
Sheet Y

I want to copy DEF from worksheet X to sheet Y

Kind regards, Stefan van der Hooft.


Stefan van der Hooft

Copy Excel tab (worksheet) to another Excel file
 
Dear Tom Ogilvy,

Thank you for your reply, however I have one question left:
- I want to copy several worksheets from several excel files through a
button on a MS Access form, is this possible with the mentioned below code?

Kind regards, Stefan van der Hooft




"Tom Ogilvy" wrote:

With Workbooks("Y.xls")
workbooks("X.xls").Worksheets("DEF").copy After:= _
.Worksheets(.worksheets.count)
End With

as an example. Both workbooks must be open.

--
Regards,
Tom Ogilvy


"Stefan van der Hooft" wrote:

Hi!

I have a question about Excel tabs (worksheets)

Is there a possibility to copy a tab-page (worksheet) from an Excel file to
another Excel file. I know that it is possible within the same Excel file,
but is it also possible to copy outside this file?

Example:
Sheet X with worksheet ABC DEF GHJ
Sheet Y

I want to copy DEF from worksheet X to sheet Y

Kind regards, Stefan van der Hooft.



All times are GMT +1. The time now is 11:39 AM.

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