VBA & Macro Problems

How to Save an Excel Macro for Use in All Workbooks

Ayan MasoodAyan Masood Oct 20, 2026 870 views

Question details

The user wants to make a custom Excel macro accessible globally across multiple workbooks rather than restricting it to a single file.

How to Save an Excel Macro for Use in All Workbooks
Product
Excel
Device & OS
not provided
Scenario
Streamlining repetitive tasks by running the same macro across different Excel files on the same computer.
Observed behavior
The goal is to successfully store and run macros from the Personal Macro Workbook (PERSONAL.XLSB) so they are available in any open Excel session.
Before you start

Ensure the Developer tab is enabled in your Excel ribbon and that you have enabled macros in the Trust Center settings.

Solution 1Recommended

Save the Macro to the Personal Macro Workbook (PERSONAL.XLSB)

By storing your macro in PERSONAL.XLSB, it opens in the background every time you start Excel, making its macros available globally.

If you have never used the Personal Macro Workbook on your computer, you will first need to create it by recording a temporary dummy macro before moving your existing VBA modules.

1
Create the Personal Macro Workbook

If you don't already have a PERSONAL.XLSB file, go to the Developer tab, click 'Record Macro', select 'Personal Macro Workbook' under the 'Store macro in' dropdown, and click OK. Stop recording immediately.

2
Open the VBA Editor

Press Alt + F11 on your keyboard to open the Visual Basic for Applications (VBA) Editor. You should now see 'VBAProject (PERSONAL.XLSB)' listed in the Project Explorer pane on the left.

3
Copy the Macro Module

In the Project Explorer, find the workbook that currently contains your target macro. Drag the module containing your macro into the 'VBAProject (PERSONAL.XLSB)' directory, or copy and paste the code into a new module within PERSONAL.XLSB.

4
Save the Personal Macro Workbook

Close the VBA Editor and then close Excel entirely. A prompt will appear asking if you want to save changes to the Personal Macro Workbook. Click 'Save' to ensure the macro is available for all future sessions.

Save the Macro to the Personal Macro Workbook (PERSONAL.XLSB)
Global Macro Accessibility: Your macro is now globally available. You can assign it to a custom button on the Quick Access Toolbar for easy one-click execution in any workbook.
Automate Tasks with WPS Office

Manage Macros Seamlessly with WPS Spreadsheet

WPS Office provides excellent support for VBA macros, allowing you to automate tasks across all your spreadsheets seamlessly. Its lightweight architecture and intuitive Developer tools make managing global macros effortless.

  1. 1. Enable the Developer Tab: Go to Menu > Options > Customize Ribbon and check the 'Developer' option to reveal macro tools on your main interface.
  2. 2. Open the VBA Editor: Click on 'VBA Editor' in the Developer tab or press Alt + F11 to open the built-in coding environment.
  3. 3. Organize Your Macros: Create new modules and manage your VBA code across different workbooks with a familiar, easy-to-use interface.
Fully compatible with Microsoft Excel VBA scripts and macro-enabled formats (.xlsm, .xlsb).Lightweight design ensures complex macros run quickly and efficiently without lagging.Intuitive Developer tab for easy creation, editing, and execution of your global scripts.
microsoft office alternative - wps office

Frequently Asked Questions

Where is the PERSONAL.XLSB file saved on my computer?

The Personal Macro Workbook is typically saved in the XLSTART folder. For most Windows users, the file path is C:\Users\[Username]\AppData\Roaming\Microsoft\Excel\XLSTART.

Why can't I see the Developer tab in Excel?

The Developer tab is hidden by default to simplify the interface. To enable it, go to File > Options > Customize Ribbon, and check the box for 'Developer' in the right-hand list of main tabs.

How do I edit or delete a macro stored in the Personal Macro Workbook?

Press Alt + F11 to open the VBA Editor, expand VBAProject (PERSONAL.XLSB), open the Modules folder, and double-click the module to edit the code. To delete it entirely, right-click the module and select 'Remove Module'.

Can I share my Personal Macro Workbook with colleagues?

Yes. You can navigate to your XLSTART folder via File Explorer, copy the PERSONAL.XLSB file, and paste it into the XLSTART folder on your colleague's computer to share all contained macros.