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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Dryver14

Well-known Member
Joined
Mar 22, 2010
Messages
2,396
are they for public consumption or could they just not live in your personal workbook
 

cazdealer

Board Regular
Joined
Mar 12, 2011
Messages
96
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.
 
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,163,710
Messages
5,833,247
Members
430,200
Latest member
ADLHMA2022

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