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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,214,787
Messages
6,121,569
Members
449,038
Latest member
Guest1337

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