Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to write a VBA script in one workbook, and use it in other workbooks in the machine? I guess I'm looking for a way to write a macro package.

EDIT Following the instruction in the link given by Lance, I managed to create the addin, but I cannot see it in the 'Macros' tab. What am I missing?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

There are a few ways to do this, here's one link that explains how to create an Excel Addin with VBA code. You can also create other types of addins in other ways, but this is the simplest. There are thousands of references you can search for that talk about how to do this.

share|improve this answer
+1 best method. –  brettdj Sep 26 '11 at 10:15

I've done this before and it is very simple and easy to do =) - Deploy your Excel macros from a central file

share|improve this answer
This is easier then creating an add-in. I just needed a 'backup' macro (stackoverflow.com/questions/15267796/…) that runs on my machine for every spreadsheet. –  Jan Doggen Aug 16 '14 at 14:19

No addon making required!

Store it in a special workbook called Personal.xlsb


This advanced tip shows you how to make macros available across all your workbooks, by saving them to a special workbook that Excel loads each time it is opened.


If you found this video helpful, kindly edit this answer to add transcribed text.

share|improve this answer
Not bad. Didn't know that +1 –  nixda Dec 18 '14 at 18:39
This is good only if other users does not have their own set of VBA codes in that .xlsb file. I have not tested what will happen if Sub name clash between multiple .xlsb file in XLSTART folder –  PatricK Mar 3 at 5:11
@PatricK Of course not. It works with multiple users in a windows machine. Each user gets their own XLSTART folder. Notice that path to XLSTART looks like C:\Users\<UserName>\AppData\Roaming\Microsoft\Excel\XLSTART . Since there is a Username, its different for each user –  Dheeraj Bhaskar Mar 3 at 15:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.