Pinterest Pixel

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

A lot of Excel users get confused when they are recording an Excel Macro and they get... read more

John Michaloudis
Posted on

Overview

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

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 itEmail this to someone

email

Pin on Pinterest

Pinterest

Share on Facebook

Facebook

Tweet about this on Twitter

Twitter

Share on LinkedIn

Linkedin

Where To Store Your VBA Macro In? This Workbook or Personal Macro Workbook | MyExcelOnline
Founder & Chief Inspirational Officer at MyExcelOnline.com

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 Academy Online Course.

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!