How to See Macros in Excel: A Step-by-Step Guide
In this article
To see the macros in an Excel workbook, you can use the Macros dialog box by going to the View tab and clicking Macros, or by using the Developer tab. If you need to see the actual code behind a macro, you must open the Visual Basic Editor (VBE) via the Developer tab or by pressing Alt + F11.
What You'll Need
- A computer with Microsoft Excel installed.
- An Excel file that contains macros (files ending in .xlsm, .xlsb, or .xls).
- Administrative permissions to enable the Developer tab if it is currently hidden.
Step-by-Step
Depending on whether you want to see a list of available macros or the actual programming code, follow the corresponding method below. Note that menu labels may differ slightly depending on your version of Excel or region.
Method 1: Viewing the List of Available Macros
This method is best if you want to see which macros are present in the workbook and run them without looking at the code.
- Open the Excel workbook containing the macros.
- Click on the View tab in the top ribbon.
- In the Macros group, click the Macros button.
- A dialog box will appear listing all the macros available in the open workbooks.
- Select a macro from the list. To see the code for that specific macro, click the Edit button.
Method 2: Enabling the Developer Tab
The Developer tab is the central hub for all macro and VBA (Visual Basic for Applications) tools, but it is hidden by default in most Excel installations.
- Right-click anywhere on the top ribbon.
- Select Customize the Ribbon from the context menu.
- In the right-hand column under Main Tabs, find the checkbox labeled Developer.
- Check the box and click OK. The Developer tab will now appear in your top menu.
Method 3: Viewing the Macro Code (VBA Editor)
If you need to see the logic, variables, and steps written in the macro, you must enter the Visual Basic Editor.
- Click on the Developer tab you enabled in Method 2.
- In the Code group, click the Visual Basic button. (Alternatively, press Alt + F11 on your keyboard).
- The Visual Basic Editor window will open. On the left side, you will see the Project Explorer pane.
- Expand the folder for your current workbook.
- Look for the Modules folder. Click the plus sign (+) to expand it.
- Double-click on a module (e.g., Module1) to open the code window and view the macro scripts.
Common Mistakes
- Opening the wrong file type: Trying to find macros in a standard .xlsx file. Standard workbooks cannot store macros; they must be saved as .xlsm (Excel Macro-Enabled Workbook) or .xlsb (Excel Binary Workbook).
- Ignoring Security Warnings: When opening a macro-enabled file, Excel often displays a yellow "Security Warning" bar at the top stating that macros have been disabled. If you do not click Enable Content, the macros may not appear or function correctly.
- Searching for "Macros" in the Home tab: The macro tools are located in the View and Developer tabs, not the Home tab.
Tips
- Keyboard Shortcuts: Use Alt + F8 to quickly open the Macro dialog box without navigating through the ribbon.
- Personal Macro Workbook: If you have macros that appear in every Excel file you open, they are stored in the "Personal.xlsb" workbook. You can find these by looking for the Personal project in the Visual Basic Editor's Project Explorer.
- Read-Only Mode: If a file is opened in "Protected View," you cannot see or run macros until you click "Enable Editing."
Troubleshooting
If you followed the steps but cannot see your macros, try these solutions in order:
- Check the File Extension: Ensure the file ends in .xlsm or .xlsb. If it is a .xlsx file, the macros were stripped out when the file was saved, and they cannot be recovered.
- Check Trust Center Settings: Go to File > Options > Trust Center > Trust Center Settings > Macro Settings. Ensure that "Disable all macros with notification" is selected. If macros are completely disabled without notification, they may not appear.
- Check for Hidden Workbooks: Some macros are stored in hidden workbooks. In the Visual Basic Editor, check the Project Explorer to see if there are other projects listed.
- Restart Excel: If the Developer tab refuses to appear after customizing the ribbon, restart the application to refresh the UI.
Frequently Asked Questions
Why is the Developer tab missing?
Microsoft hides the Developer tab by default because it is used primarily by advanced users. You can enable it via the Customize the Ribbon menu.
Can I see macros in Excel for the Web?
Excel for the Web has limited support for macros. While you can run some macros in the browser, you generally cannot view or edit the VBA code; you must open the file in the Excel desktop application to do that.
What is the difference between a Macro and VBA?
A macro is the recorded sequence of actions that Excel performs automatically. VBA (Visual Basic for Applications) is the programming language used to write those macros.
Is it safe to view macros in a file from an unknown source?
Viewing the code in the Visual Basic Editor is generally safe, but you should never "Run" a macro from an untrusted source, as macros can be used to execute malicious code on your computer.
Where are macros stored if they aren't in the module?
Macros can be stored in "Modules," but they can also be written inside "Sheet" objects or "ThisWorkbook" objects to trigger specific events (like opening the file). Check all folders in the Project Explorer in the VBA Editor.