How to have a macro on other workbooks

daskalo

New Member
Joined
Jul 21, 2010
Messages
24
Hey guys, i know this is probably very simple, but I cant figure it out. Is there any way to create like a library of macros so every time i open excel the macros will be there without mattering on what sheet or workbook I am on?

Thanks

Edit: I use MS Excel 2007
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
The right way to do that is while creating the macro select save in Personal Macro workbook.

In case you want to make a library kind of thing which you'dlike to share with others too what I do is create all the macros in one file say library.xls.

Then whenever I want to use the macro I simply open my library.xls file, open any other excel file and automatically all the macros written in the library file will be available in the new file.

Hope this helps

Vinci
 
Upvote 0
Yes, you would either have to use Workbook_Open() macro in VBE

or in case, it is an excel add-in, just put the file into C:\Users\YourName\AppData\Roaming\Microsoft\Excel\XLSTART
 
Upvote 0
I usually record all of my macros. So i record them on one sheet, but how can i put them on libary.xls for example so I have them in one place?
 
Upvote 0
If it's just for your use then the personal.xls suggestion by Vog will do the trick nicely. If the macros are for distribution to other people then an add-in is almost certainly the way you should go.

For the latter though you would need to be sure that your recorded code would work in an add-in. Some info can be found here.

Dom
 
Upvote 0
You can open the VBA Editor Ctrl+F11, then select Insert ? Modules then from your left pane double click on the sheet name, you should be able to see your macros copy them and paste it into the Module.

Once your macros are in the Modules, then just save the file as library.xls

Now whenever you want to use these macros on another file.. just keep the library.xls file open , then open your other files, and you can access all these macros there.

Hope this helps

Vinci
 
Upvote 0

Forum statistics

Threads
1,217,764
Messages
6,138,474
Members
450,141
Latest member
Hal5000

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