VBA questions about where to put macros available to all workbook

cazdealer

Board Regular
Joined
Mar 12, 2011
Messages
96
Hi,
I have different macros in different workbooks.
Now, it's complicated for me if I want to use a macro I created in another workbook. I have to open VBA copy it to the new workbook.
I'm sure there is a way to make the macros available to any workbook.

so 2 questions:

1: Where do I put those macros (right now, there are in Module,1,2,3,4 of different workbooks).

2: Some macro use this code line at one point
thisworkbook.active
because it switches from one workbook to another...
will this still work if the macro is not written anymore in the module of that particular workbook?


thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I don't really understand your questions...

I want to use them with any workbook I open with my own Excel. I don't want to have to always copy the VBA from the workbook it's in right now.

I would like to put them somewhere in my own Excel or VBA to with allow me to use them with only my computer.
 
Upvote 0

Forum statistics

Threads
1,224,575
Messages
6,179,637
Members
452,934
Latest member
Jdsonne31

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
Back
Top