Pinterest Pixel

Where To Store Your VBA Macro In? This Workbook or Personal Macro Workbook

John Michaloudis
A lot of Excel users get confused when they are recording an Excel Macro and they get prompted where they want to store their Excel Macro in?

A lot of Excel users get confused when they are recording an Excel Macro and they get prompted where they want to store their Excel Macro in?

Where To Store Your VBA Macro In? This Workbook or Personal Macro Workbook

 

Store Macro In

You have 3 options:

* Personal Macro Workbook

* New Workbook

* This Workbook

During the initial setup of recording a macro a prompt will present itself asking where the macro should be stored.  This option ultimately determines not only where the macro will be saved, but also where you can access the macro and where it can be used.

 

This Workbook

The “THIS WORKBOOK” option will create a module within the active workbook where Excel will save the macro (VBA Code). By storing the macro in the active workbook, the macro can be used within the that workbook or if that workbook is open.

Since the macro is contained with the workbook it was created within, if the workbook is sent to another Excel user or placed on a network drive, the macro will be there as well and other users can use that macro when that workbook is open on their system.

Files that contain a macro or VBA code must be saved as a .XLSM (MACRO ENABLED WORKBOOK) or .XLSB file.

Some Common Uses:

  • Macros that are specific to a workbooks data
  • Macros that make data connections and refreshes of data contained with the workbook
  • Macros that clean up data specific to the workbook

 

Personal Macro Workbook

The PERSONAL MACRO WORKBOOK is a hidden workbook located on a machine that contains Microsoft Excel.

The workbook is always open, but, hidden from view by default.

If a macro is stored in the PERSONAL MACRO WORKBOOK, this macro can be used within any workbook on the computer that contains that personal macro workbook.

Macros stored in a personal macro workbook are not typically shared through normal exchange of Excel files. To share a macro contained within the personal workbook, one would need to explicitly share their personal macro workbook, export the module that contains the macro or copy the code to another file and send that new file.

Some Common Uses:

  • One-time setup macros that can be used on multiple workbooks
  • Macros that are more specific to an individual job that isn’t shared among others
  • Repetitive tasks necessary across multiple Excel files

 

New Workbook

A NEW WORKBOOK creates a brand new workbook at time of recording. This new workbook will contain the macro and all of the VBA code.

In order to use these macros you must open the new workbook that Excel created.

Not as common as the other two!

 

If you like this Excel tip, please share it


Founder & Chief Inspirational Officer

at

John Michaloudis is a former accountant and finance analyst at General Electric, a Microsoft MVP since 2020, an Amazon #1 bestselling author of 4 Microsoft Excel books and teacher of Microsoft Excel & Office over at his flagship MyExcelOnline Academy Online Course.

See also  Delete Blank Worksheets Using Macros In Excel

Steps To Follow

Star 30 Days - Full Access Star

One Dollar Trial

$1 Trial for 30 days!

Access for $1

Cancel Anytime

One Dollar Trial
  • Get FULL ACCESS to all our Excel & Office courses, bonuses, and support for just USD $1 today! Enjoy 30 days of learning and expert help.
  • You can CANCEL ANYTIME — no strings attached! Even if it’s on day 29, you won’t be charged again.
  • You'll get to keep all our downloadable Excel E-Books, Workbooks, Templates, and Cheat Sheets - yours to enjoy FOREVER!
  • Practice Workbooks
  • Certificates of Completion
  • 5 Amazing Bonuses
Satisfaction Guaranteed
Accepted paymend methods
Secure checkout

Get Video Training

Advance your Microsoft Excel & Office Skills with the MyExcelOnline Academy!

Dramatically Reduce Repetition, Stress, and Overtime!
Exponentially Increase Your Chances of a Promotion, Pay Raise or New Job!

Learn in as little as 5 minutes a day or on your schedule.

Learn More!

Share to...