Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Find Macros in Excel: Step-by-Step Guide

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You find macros in Excel in one of four places, depending on what you mean: the Developer tab (Visual Basic, Macros, Record Macro), the Alt+F8 Macro dialog for macros that already exist, the Personal Macro Workbook at %APPDATA%\Microsoft\Excel\XLSTART\PERSONAL.XLSB for macros that run in every workbook, and any .xlsm or .xlsb file that already contains code. If the Developer tab is missing from your ribbon, it is simply hidden: open File > Options > Customize Ribbon, tick Developer in the right-hand list, and click OK. The rest of this guide walks through each location, explains what you are looking at when you get there, and covers what to do when a macro you expect to see does not appear.

What You'll Need

  • Any desktop version of Excel on Windows or Mac. The browser version cannot record or run macros, and the Developer tab does not exist there, so none of these steps apply in Excel for the web.
  • Permission, if you are not the file's owner. Macros may be blocked by a Trust Center setting or by a policy your organisation controls, and you cannot always change that yourself.
  • Enough understanding of the file to know whether the macro lives in it or in a personal workbook. Every macro belongs to a specific document, which is the single most common reason a macro appears to vanish.

Step-by-Step

1. Unhide the Developer tab

  1. Open Excel with any workbook.
  2. Go to File > Options. On Mac, use Excel > Preferences instead; the option lives under Ribbon & Toolbar.
  3. Select Customize Ribbon in the left list.
  4. In the right-hand list of tabs, tick the box next to Developer.
  5. Click OK. The tab appears at the right end of the ribbon.

From the Developer tab you get three separate routes to macros: Visual Basic opens the editor where the code lives, Macros lists runnable procedures in a dialog, and Record Macro creates a new one. Menu labels vary slightly between versions, platforms and regions, but these names have stayed stable for years.

2. Use the Macro dialog for a quick inventory

  1. Press Alt+F8 on Windows, or Option+F8 on Mac, or click Developer > Macros.
  2. Look at the Macros in dropdown at the bottom of the dialog. It lists every open workbook plus Personal.xlsb, so you can see exactly which file holds which macro.
  3. Leave it set to All Open Workbooks if you want the full picture, or pick one file to narrow the list.
  4. Select a name to see its shortcut key (if any) and its description below the list. Click Cancel rather than Run unless you intend to execute it, since a macro can change data immediately and Excel's undo stack does not cover most macro actions.

Anything in this list is a macro you can run right now. A macro missing from here either lives in a workbook that is not open, or is stored as a Private procedure that the dialog deliberately hides, which is covered in Troubleshooting.

3. Open the Visual Basic Editor to see the underlying code

  1. Press Alt+F11 on Windows, or click Developer > Visual Basic. On Mac this shortcut may need fn held depending on your keyboard, or use the Developer tab button.
  2. In the Project Explorer on the left, expand the entries under VBAProject. Each open workbook appears as its own tree, and Personal.xlsb appears if it is loaded.
  3. Look for two things inside each workbook: Modules (standard code), and Sheet or ThisWorkbook objects (code tied to those events).
  4. Double-click a module and the code appears on the right. To view a hidden module, right-click its project, choose VBAProject Properties, open the Protection tab, and see whether a password is set.

If the Project Explorer is not visible, use View > Project Explorer inside the editor. If a project does not appear at all, the workbook is not open in the same Excel instance, or its project is locked with a password you do not have.

4. Find macros stored outside the current workbook

Excel keeps two kinds of macro storage that are easy to miss. The first is the Personal Macro Workbook: a hidden file named PERSONAL.XLSB in the XLSTART folder, loaded automatically in every session. Unhide it with View > Unhide, or open the editor and look for its project. Anything you recorded with "Personal Macro Workbook" selected as the store location ends up there, which is why a macro can run in a new file and yet never appear in that file's code. The second kind is add-ins: .xlam files loaded under Developer > Excel Add-ins, whose macros run with Excel but live in the add-in. Tick or untick boxes there to load and unload them, and look in the VBA editor under the add-in's own project to read the code.

5. Check whether a file contains macros before enabling anything

  1. Look at the extension: .xlsx and .xls cannot store VBA, while .xlsm and .xlsb can. A file named .xlsm that contains no code is common, since removing macros does not rename it.
  2. When Excel shows a yellow security bar mentioning blocked macros, do not click Enable Content on a file you received from someone you do not trust. Macro code can delete files, reach the internet and change your system, so only enable content you have from a source you know.
  3. To confirm what code a file holds, open the VBA editor and inspect its project before running anything.

Common Mistakes

  • Looking for macros in Excel for the web. They are not available there, so the Developer tab is missing by design rather than by a setting you got wrong.
  • Forgetting that a macro belongs to one workbook. Closing the file removes it from the Macro dialog, which looks like deletion when it is not.
  • Assuming a .xlsm extension means the file actually contains macros. It only means it is allowed to.
  • Confusing the Macro dialog with the editor. The dialog shows only procedures you can call directly, not Private routines or event code.
  • Clicking Run while browsing, instead of Cancel. Many macros write over cells and cannot be undone with Ctrl+Z, so save first.

Tips

Name your macros something meaningful, because the dialog is alphabetical and a list full of Macro1, Macro2 and Macro3 is hard to use. Record a description in the Record Macro dialog; it shows in the Macro dialog and saves you opening the code to remember what a routine does. Press F2 in the editor for the Object Browser, which searches every loaded project at once and is faster than clicking through trees when you cannot remember where something lives. Before you record anything, decide the store location deliberately: This Workbook for code tied to one file, Personal Macro Workbook for something you want in every workbook. Turn on Require Variable Declaration in the editor's Tools > Options, since it prevents whole categories of silent bugs in code you write later.

Troubleshooting

The Developer tab will not stay visible

Your organisation may control the ribbon through policy. On a managed machine, options greyed out in Customize Ribbon mean exactly that; ask IT rather than reinstalling Excel.

Macros are greyed out entirely

A Trust Center setting or a policy is blocking them. Check File > Options > Trust Center > Trust Center Settings > Macro Settings, but be careful about lowering protection, and note that Excel for the web cannot enable them at all.

A macro you know exists is not in the list

Open the workbook containing it. If it should live in the Personal Macro Workbook, unhide that file or confirm the XLSTART folder location, then reopen Excel. If it was saved as Private, it can still be called from another macro but will not appear in the dialog, so inspect the project in the editor.

Files are read-only or macros are disabled with a warning you cannot dismiss

A file downloaded from the internet carries Windows' mark-of-the-web. Unblock it through the file's Properties in File Explorer, after you have satisfied yourself it is safe, or copy it to a trusted location.

You see runtime errors when you run a found macro

Most such errors come from a macro written for a different workbook, sheet or cell layout. Read the code before editing anything, and keep a copy of the original file so you can go back.

Frequently Asked Questions

Where does Excel store macros?

Inside the workbook that contains them (an .xlsm or .xlsb file), in the hidden Personal Macro Workbook, or in an .xlam add-in. There is no single central library otherwise.

Why can't I see the Developer tab?

It is hidden by default. Enable it via File > Options > Customize Ribbon. On Mac it is under Excel > Preferences > Ribbon & Toolbar.

Can I find macros without the Developer tab?

Yes. Alt+F8 opens the Macro dialog and Alt+F11 opens the Visual Basic editor directly.

How do I see macros in a workbook I was sent?

Open the file, then inspect its project in the VBA editor using the steps above. Do not enable content or run code until you trust the sender.

Does the macro list show every macro in the workbook?

No. It omits Private procedures and event-handler code attached to sheets or ThisWorkbook. The editor shows the complete picture.

Can I find macros on a phone or in the browser?

No. The mobile and browser versions of Excel cannot record or run VBA macros; you need the desktop application.