Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 279
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying workbook formating to a differnent workbook Roger Excel Worksheet Functions 0 October 30th 09 05:27 PM
Macro for Copying Worksheet to New Workbook MGC Excel Discussion (Misc queries) 10 August 17th 07 01:57 AM
Copying A Worksheet From Each Open Workbook to an new Workbook carl Excel Worksheet Functions 1 January 3rd 06 05:37 PM
Copying a workbook with custom toolbar assigned to a macro Matt W Excel Discussion (Misc queries) 1 February 4th 05 10:46 PM
Copying VBA modules from one workbook to another with a macro? Revolvr[_2_] Excel Programming 2 May 6th 04 11:04 AM


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"