ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copying macro to a new workbook (https://www.excelbanter.com/excel-programming/317721-copying-macro-new-workbook.html)

JT[_2_]

copying macro to a new workbook
 
Workbook 1 contains a push button. Attached to the push
button is a macro that performs a couple of edits and
sends an e-mail.

I have another macro that makes copies of the data in
Workbook 1 for each business unit. Each copy contains the
same push button. However, the macro attached to the push
button in Workbook 1 is not carried forward with the
copies of the data for each business unit.

Any help in copying the data and macro to the "new"
workbooks would be appreciated. Thanks

Ron de Bruin

copying macro to a new workbook
 
Hi JT

If you copy a whole worksheet to a new workbook and send that then
you can use a button from the Control toolbox and copy your code in the
Click event of this button.(This is in the Sheet module)


--
Regards Ron de Bruin
http://www.rondebruin.nl


"JT" wrote in message ...
Workbook 1 contains a push button. Attached to the push
button is a macro that performs a couple of edits and
sends an e-mail.

I have another macro that makes copies of the data in
Workbook 1 for each business unit. Each copy contains the
same push button. However, the macro attached to the push
button in Workbook 1 is not carried forward with the
copies of the data for each business unit.

Any help in copying the data and macro to the "new"
workbooks would be appreciated. Thanks




Ed

copying macro to a new workbook
 
Ron,

I also want to copy a micro to a new wookbook but I want to automate the
process so the the macro copy s done without user action.

I have tried the mergeworkbook method but it does not copy the macro.

Is there VB code that will copy a macro to a new workbook without user
intervention?

Thanks,
Ed

"Ron de Bruin" wrote:

Hi JT

If you copy a whole worksheet to a new workbook and send that then
you can use a button from the Control toolbox and copy your code in the
Click event of this button.(This is in the Sheet module)


--
Regards Ron de Bruin
http://www.rondebruin.nl


"JT" wrote in message ...
Workbook 1 contains a push button. Attached to the push
button is a macro that performs a couple of edits and
sends an e-mail.

I have another macro that makes copies of the data in
Workbook 1 for each business unit. Each copy contains the
same push button. However, the macro attached to the push
button in Workbook 1 is not carried forward with the
copies of the data for each business unit.

Any help in copying the data and macro to the "new"
workbooks would be appreciated. Thanks





Tom Ogilvy

copying macro to a new workbook
 
Try looking at Chip Pearson's page on working with code in the VBE

http://www.cpearson.com/excel/vbe.htm

--
Regards,
Tom Ogilvy


"Ed" wrote in message
...
Ron,

I also want to copy a micro to a new wookbook but I want to automate the
process so the the macro copy s done without user action.

I have tried the mergeworkbook method but it does not copy the macro.

Is there VB code that will copy a macro to a new workbook without user
intervention?

Thanks,
Ed

"Ron de Bruin" wrote:

Hi JT

If you copy a whole worksheet to a new workbook and send that then
you can use a button from the Control toolbox and copy your code in the
Click event of this button.(This is in the Sheet module)


--
Regards Ron de Bruin
http://www.rondebruin.nl


"JT" wrote in message

...
Workbook 1 contains a push button. Attached to the push
button is a macro that performs a couple of edits and
sends an e-mail.

I have another macro that makes copies of the data in
Workbook 1 for each business unit. Each copy contains the
same push button. However, the macro attached to the push
button in Workbook 1 is not carried forward with the
copies of the data for each business unit.

Any help in copying the data and macro to the "new"
workbooks would be appreciated. Thanks








All times are GMT +1. The time now is 09:11 PM.

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