Create and save all your macros in a single workbook

When you first create a macro in a workbook, it works only in that workbook. But what if you want to use the macro in other workbooks? To make your macros available every time you open Excel, you can create them in a workbook called Personal.xlsb. That’s a hidden workbook stored on your computer, which opens every time you open Excel.

Before you get started, make sure the Developer tab is shown on the ribbon. If it’s not there, do the following:

  1. Click File > Options > Customize Ribbon.

  2. Under Customize the Ribbon, in the Main Tabs box, check the Developer box, then OK.

Next, create a macro. We’ll record a very simple example that will format the text in the current cell as bold.

You can learn more about creating macros in Quick start: Create a macro.

  1. In cell A1, enter “Some text,” and then press Enter.

  2. Click Record Macro.

    Code group on the Developer tab

  3. In the Record Macro dialog box, type a name for the macro in the Macro name box. For example, type BoldMe.

    Don’t use any spaces in the name.

  4. In the Store macro in box, pick Personal Macro Workbook > OK. This is the most important step, because if you don't already have a Personal Macro Workbook, Excel will create one for you.

  5. Click in cell A1 and press Ctrl+B to apply bold formatting.

    That’s the only step in the macro.

  6. Click Developer > Stop Recording.

  7. Close any open workbooks, and then exit Excel.

    A message appears that prompts you to save the changes that you made to the Personal Macro Workbook.

    Click Save to save the personal workbook.

The next time you open Excel, the macro you created is available. To see it:

  1. Click Developer > Macros to launch the Macro dialog.

    Our example macro is called PERSONAL!.BoldMe.

  2. If you don’t see the macro, in the Macros in box, click PERSONAL.XLSB.

    To run the macro, see Run a macro.

Moving macros from one computer to another

Say that you get another computer and want to move or copy all of your macros to that computer, or you want to share your macros with someone else. It’s not possible to share your Personal.xlsb between computers, but you can copy it to the XLSTART folder on other computers or copy some or all of its macros to the Personal.xlsb file on other computers. In Windows Explorer you can search for XLSTART to locate the folder.

If you have one or just a few macros that you want to share with others, you can send them the workbook that contains it in an email message. You can also make the workbook available on a shared network drive or from a SharePoint Services library.

For more information about copying a macro from one workbook to another, see Copy a macro module to another workbook.

Unhide your personal workbook

Any macros you save to the personal workbook can be edited only by first unhiding the personal workbook. When you start Excel, the personal workbook is loaded but you can’t see it because it’s hidden. To see it:

  1. Click View > Unhide.

  2. In the Unhide dialog box, you should see PERSONAL.XLSB.

  3. Click OK to view the personal workbook.

  4. To hide the personal workbook, make sure you have Personal.xlsb selected, and then click Hide on the View tab.

  5. PERSONAL.XLSB will always be editable in the Visual Basic Editor (VBE).

Any time you create a new macro and save it in your personal workbook or update any macros that it contains, you are prompted to save the personal workbook just as it did the first time you saved it.

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×