How to Save a Macro for All Workbooks in Excel (Easy Steps)

Step 1 – Open the Developer Tab in Excel

Opening Developer Tab to Save a Macro in Excel for All Workbooks

Read More: How to Save Macros in Excel Permanently (2 Suitable Ways)


Step 2 – Start the Macro Recording

  • Click the Record Macro button in the Developer tab.

Start Recording a Macro to Save a Macro in Excel for All Workbooks

  • In the Record Macro dialog, name your macro (default is Macro1).
  • Choose Personal Macro Workbook from the Store macro in checkbox and click OK.

Recording Macro to Save a Macro in Excel for All Workbooks

Read More: Excel VBA to Save File with Variable Name (5 Examples)


Step 3 – Stop the Macro Recording

  • Once you click OK, the macro recording starts.
  • Click the Stop Recording button (same position as Record Macro) to stop recording.


Similar Readings


Step 4 – Open Visual Basic Editor to View the Macro

  • Press ALT + F11 to open the Visual Basic window.
  • In the right pane, find the Module1 macro under VBAProject (PERSONAL.xlsb).

Opening the VBA Editor to Save a Macro in Excel for All Workbooks

Read More: Excel VBA: Save Sheet as New Workbook without Opening


Step 5 – Insert the Necessary Code 

  • The inside of the macro is empty.
  • Insert your VBA code within it (between Sub Macro1 and End Sub).

Read More: Excel VBA: Save Workbook in Specific Folder (4 Suitable Examples)


Step 6 – Close and Save the Macro

  • Close the workbook.
  • When prompted, save the PERSONAL.xlsb file.

Closing the File to Save a Macro in Excel for All Workbooks

You have saved the Macro successfully for all the workbooks on your computer.

Read More: Excel VBA: Save and Close Workbook (5 Suitable Examples)


Step 7 – Save the Macro for All Workbooks in Excel

  • Open any Excel file on your computer, whether it’s an existing workbook or a new one.
  • Press ALT + F11 on your keyboard to open the Visual Basic window.
  • Look for the Macro under the VBAProject (PERSONAL.xlsb) section in the right pane. It will be available in all the workbooks on your computer.

Read More: Excel Macro Enabled Workbook (5 Easy Ways to Open)


Things to Note

What you’ve actually done is create a new Microsoft Excel Binary File called PERSONAL.xlsb on your computer. If you want to remove it from the Visual Basic pane, simply locate the file on your computer and delete it. Most of the time, you’ll find it in the directory C:\Users\ABFA Computers\AppData\Roaming\Microsoft\Excel\XLSTART.


Download Practice Workbook

You can download the practice workbook from here:


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Rifat Hassan
Rifat Hassan

Rifat Hassan, BSc, Electrical and Electronic Engineering, Bangladesh University of Engineering and Technology, has worked with the ExcelDemy project for almost 2 years. Within these 2 years, he has written over 250 articles. He has also conducted a few Boot Camp sessions on effective coding, especially Visual Basic for Applications (VBA). Currently, he is working as a Software Developer to develop and deploy additional add-ins to enhance the customers with a more sophisticated experience with Microsoft Office Suits,... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo