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

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
40,114
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
40,114
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,812
Office Version
  1. 365
Platform
  1. Windows
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.
 

Forum statistics

Threads
1,186,165
Messages
5,956,322
Members
438,247
Latest member
UZev

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