Make an Excel Macro Available in Every Workbook
Question details
Make an Excel macro available across new and existing workbooks.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to run the same macro in new workbooks and files exported from other applications.
- Observed behavior
- A macro stored in a standard workbook is available only while that workbook is open.
Use the desktop version of Excel and locate the macro you want to reuse. If the Developer tab is hidden, enable it through Excel's ribbon settings.
Store the macro in Excel's Personal Macro Workbook
Use PERSONAL.XLSB to load your macro whenever Excel starts.
In Excel, select Developer > Record Macro. Under Store macro in, choose Personal Macro Workbook, select OK, and then select Developer > Stop Recording. Skip this step if PERSONAL.XLSB already exists.
Select Developer > Visual Basic. In the Project Explorer, locate the workbook containing your existing macro and expand its Modules folder.
Open the module containing the macro and copy its code. In the PERSONAL.XLSB project, open an existing standard module or select Insert > Module, then paste the code there.
Close Excel completely. When prompted to save changes to PERSONAL.XLSB, choose Save.
Restart Excel and open the workbook you want to use. Select Developer > Macros, choose the macro from PERSONAL.XLSB, and select Run.

Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format compatibility, making it easy to move everyday workbook tasks from Excel. VBA support depends on the WPS version and edition, so check compatibility before relying on existing macros.

Frequently Asked Questions
Why is my macro still available only in the original workbook?
The code may still be stored in that workbook rather than PERSONAL.XLSB. Open Developer > Visual Basic and check which project contains the macro, then copy it into a standard module in the PERSONAL.XLSB project.
Do I need to save every workbook as XLSM to run a personal macro?
No. A macro stored in PERSONAL.XLSB can run on an open workbook without being stored in that workbook. Use XLSM when you need to save VBA code inside the workbook itself.
What if I cannot see my personal macro in the Macros dialog?
Restart Excel after saving PERSONAL.XLSB, then open Developer > Macros and check the Macros in selection. Also confirm that your macro security settings permit trusted macros to run.
Can I use PERSONAL.XLSB in Excel for the web?
No. Excel for the web does not run VBA macros. Open the workbook in desktop Excel to use a Personal Macro Workbook.




