ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Loading worksheets from an add in (https://www.excelbanter.com/excel-programming/360971-loading-worksheets-add.html)

cmpcwil2[_19_]

Loading worksheets from an add in
 

Hi,
I am trying to convert my workbook to an add in. the workbook has
worksheets that are required for it to function correctly. I am havin
great difficulty in getting each of the worksheets to copy over to th
opening workbook when installed as an add in.

tried commands such as
Workbooks("Mega.xla").Sheets(1).Copy
for each sheet but this copies each sheet to a new workbook, I wan
each sheet copied to a new workbook sheet, can anyone help?

thank

--
cmpcwil
-----------------------------------------------------------------------
cmpcwil2's Profile: http://www.excelforum.com/member.php...fo&userid=3341
View this thread: http://www.excelforum.com/showthread.php?threadid=54032


Doug Glancy

Loading worksheets from an add in
 
cmpcwil2,

Workbooks("Mega.xla").Worksheets(1).Copy
after:=Workbooks("MyBook.xls").Worksheets(1)

hth,

Doug

"cmpcwil2" wrote in
message ...

Hi,
I am trying to convert my workbook to an add in. the workbook has 3
worksheets that are required for it to function correctly. I am having
great difficulty in getting each of the worksheets to copy over to the
opening workbook when installed as an add in.

tried commands such as
Workbooks("Mega.xla").Sheets(1).Copy
for each sheet but this copies each sheet to a new workbook, I want
each sheet copied to a new workbook sheet, can anyone help?

thanks


--
cmpcwil2
------------------------------------------------------------------------
cmpcwil2's Profile:
http://www.excelforum.com/member.php...o&userid=33411
View this thread: http://www.excelforum.com/showthread...hreadid=540324




Jim Thomlinson

Loading worksheets from an add in
 
ThisWorkbook refers to the book running the code (your addin in this case) so
you should be able to do something like...

ThisWorkbook.Sheets(1).Copy Activeworkbook.Sheets(1)

To copy sheet 1 from the addin to the active workbook.
--
HTH...

Jim Thomlinson


"cmpcwil2" wrote:


Hi,
I am trying to convert my workbook to an add in. the workbook has 3
worksheets that are required for it to function correctly. I am having
great difficulty in getting each of the worksheets to copy over to the
opening workbook when installed as an add in.

tried commands such as
Workbooks("Mega.xla").Sheets(1).Copy
for each sheet but this copies each sheet to a new workbook, I want
each sheet copied to a new workbook sheet, can anyone help?

thanks


--
cmpcwil2
------------------------------------------------------------------------
cmpcwil2's Profile: http://www.excelforum.com/member.php...o&userid=33411
View this thread: http://www.excelforum.com/showthread...hreadid=540324




All times are GMT +1. The time now is 05:07 PM.

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