Store Common Macros in the Personal Macro Workbook

by Allen Wyatt
(last updated December 14, 2017)

7

Macros are often created to save time and energy, make Excel work the way we expect it to work, and to make repetitive, mind-numbing tasks somewhat more bearable. A good number of the macros I create for these reasons are ones I need to use over and over again, and I'll bet you are in the same boat.

Where, then, does one put a macro so it can be used over and over again?

The answer, of course, is to place it in a special place that is accessible regardless of the workbook on which you are working. This special place is, itself, a workbook, and it is normally hidden from prying eyes. (Actually it is hidden so it doesn't interfere with the work you are doing on other workbooks and so that you don't inadvertently make changes in it.) This special workbook is known as the Personal Macro Workbook, which is stored in a file named Personal.xlsb.

The Personal Macro Workbook isn't created by default on a system. If you want a quick way to see if one is available on your system, display the View tab of the ribbons. If the Unhide tool (in the Window group) is not available, then the Personal Macro Workbook has not been created on your system. (Remember—the Personal Macro Workbook is normally hidden, so if there is nothing to unhide, then that workbook doesn't exist.)

If the Unhide tool is available, that is not definitive proof that the Personal Macro Workbook exists, but you are a step closer to finding out. Click the tool, and you will see the Unhide dialog box. (See Figure 1.)

Figure 1. The Personal Macro Workbook exists on this system.

If the dialog box contains an entry for Personal.xlsb, then the Personal Macro Workbook exists on your system; you can skip the discussion, below, about how to create it.

To create the Personal Macro Workbook so that you can start to store macros there, the easiest way is to record a dummy macro (one you won't really use for anything) and instruct Excel to store it there. Follow these steps:

  1. Display the Developer tab of the ribbon.
  2. Click the Record Macro tool, in the Code group. Excel displays the Record Macro dialog box.
  3. In the Macro Name field, plug in any old name you want. (If you prefer, you can simply keep the suggested macro name.)
  4. Using the Store Macro In drop-down list, choose Personal Macro Workbook. (See Figure 2.)
  5. Figure 2. Make sure you choose Personal Macro Workbook.

  6. Click OK. Excel closes the Record Macro dialog box and starts the macro recorder.
  7. Press the down-arrow a single time to move from whatever cell is selected to the one just below it.
  8. On the Developer tab of the ribbon (which should still be visible), click the Stop Recording tool, in the Code group.

At this point you've created a dummy macro and Excel dutifully stores it in the Personal Macro Workbook. Since you previously had no such workbook, Excel created it for you. (You can see that it is there by again looking at the Unhide tool on the View tab of the ribbon.)

From this point on, you can easily add macros to the Personal Macro Workbook. All you need to do is follow the same steps, listed above, if you are recording a new macro. If you are writing a macro from scratch, then use the Macros dialog box (visible when you choose Macros from the Developer tab of the ribbon) and specify Personal Macro Workbook using the Macros In drop-down list.

Once a macro is stored in the Personal Macro Workbook, it is available whenever you are using Excel. The reason for this is that Excel opens the workbook whenever you start Excel. Thus, it is a great place to store the macros you want to use over and over again, regardless of where you are doing your work.

But, you ask, how does one get rid of the dummy macro you just created? Or, for that matter, how does one get rid of any other macro stored in the Personal Macro Workbook? The answer is simple: You delete the macros the same as you would delete any other macro. The trick is to remember to unhide the Personal Macro Workbook before you try to delete the macro. Remember that Unhide tool? Just go ahead and unhide the workbook. Once it is visible, you can display the Macros dialog box, as discussed above, and delete the macros it may contain.

If you unhide the Personal Macro Workbook, don't forget to hide it again. If you don't, it will be visible each time you start Excel. While this isn't fatal, it can be bothersome, so just use the Hide tool on the View tab of the ribbon to hide the workbook after you are done working with it.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13097) applies to Microsoft Excel 2007 and 2010.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Quick Access Toolbars and Templates

Want to create a customized Quick Access Toolbar and associate that toolbar with a particular template? The task is ...

Discover More

Canceling an Edit

When editing a cell, you may want to cancel the edit at some point. There are two ways to do this, both described in this ...

Discover More

Non-Printing Hyperlinks

Karen is having problems getting hyperlinks to print in a document on her home computer. There are only a limited number ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Engineering Calculations

Need to normalize your data in some way so that all your values are in a given format? This tip presents a number of ...

Discover More

Finding Positions of Formatted Characters in a Cell

With a little bit of work, Excel allows you to format individual characters of the text you place in a cell. If you want ...

Discover More

Controlling Window Size when Opening Additional Workbooks

When you open multiple workbooks, the way in which Excel sizes them is not the best for your needs. This tip looks at a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five minus 4?

2017-12-16 03:29:43

Philip

Thanks, Willy.


2017-12-15 11:46:20

Willy Vanhaelen

@Philip
XLSB is a binary file format optimized for fast loading and saving but for small files you will hardly notice the difference with XLSM. Personally I use only XLSB because their size is also smaller.


2017-12-14 17:32:10

Philip

On my system (Mac running Office 365) and also on my work PC (Windows 8 with Excel 2013), it's a Personal.xlsm (not sure if it was created by the system ever, I have historically had my own and have migrated it to the xlsm format myself when upgrading Excel versions).

What's the difference / benefit of having it saved in a xlsb format ?


2017-12-14 08:30:35

Alan Cannon

It isn't necessary to unhide Personal.xlsb to delete a macro stored there, or do anything else with Personal.xlsb. All you need to do is either press [Alt]+F11 or click "Visual Basic" on the Developer tab. This will display the Visual Basic view of all open workbooks, including Personal.xlsb.

From this view you can right click on any module in any workbook and select export if you want to generate a copy of a module to import to another system, or you can remove the module. If you choose to remove a module Excel will ask if you want to export it first.


2014-06-30 13:21:53

Glenn Case

To transfer macros between systems, you can
1) Copy the Personal.xlsb file (or the excel file containing the macro) to the new system, and run it from there;
2) Copy/paste the macro into an email, and then copy/paste from the email into a module on the new system, or
3) Create an add-in and install it on the new system.


2014-06-28 12:02:38

pegstein

How do you transfer common macros between systems? I work on a laptop and on a desktop and want to use the same macros in both places?


2014-05-05 07:20:49

Jim Autrey

Great place to store all your Excel Tips!


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.