How to create a workbook with presaved macros

masterxl

New Member
Joined
Jul 28, 2011
Messages
3
Hi All,

I am creating a VBA application, I'm faced with a problem that is-- When a ever i create a new workbook, i am unable to get macros with which it has been created..

Plz provide me the solution...

Thanks In Advance :)
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
38,066
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
I'm afraid your question makes no sense at all to me. Can you please clarify what it is you want?
 

masterxl

New Member
Joined
Jul 28, 2011
Messages
3
I'm afraid your question makes no sense at all to me. Can you please clarify what it is you want?


Sorry For Inconvenience,:(

let us assume I have macro 'A', After Running 'A', it will create workbook 'B'.

What all i need is---- The Workbook 'B' should have macro 'A'.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
38,066
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
The easiest way is to create a template that contains the macro(s) you want and then use that when you create the new workbook. Or simply save the original workbook under a new name - it will contain all the same code.
 

Ruddles

Well-known Member
Joined
Aug 24, 2010
Messages
5,789
I agree with Rory - that seems like the easiest and neatest solution.

However if you actually want to copy a module out of your workbook into another workbook, check this link.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,836
Messages
5,766,714
Members
425,373
Latest member
ndiejennrrd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top