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
 

Some videos you may like

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.

Vinci

New Member
Joined
Jul 14, 2010
Messages
6
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
 

daskalo

New Member
Joined
Jul 21, 2010
Messages
24
Question: Is it possible to have a file automatically open when I open up excel?
 

kpark91

Well-known Member
Joined
Jul 15, 2010
Messages
1,582

ADVERTISEMENT

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
 

daskalo

New Member
Joined
Jul 21, 2010
Messages
24

ADVERTISEMENT

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?
 

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
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
 

Vinci

New Member
Joined
Jul 14, 2010
Messages
6
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,577
Messages
5,596,996
Members
414,116
Latest member
sfullnet

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