Your Excel macro is missing because it wasn’t added to the personal macro workbook or the macro security settings are blocking it. Here’s the fastest fix: open the VBA editor (Alt+F11), check if your macro exists under ThisWorkbook or Personal.xlsb, then run it directly or add it to the list using Application.Macros. If that fails, re-enable macros in Trust Center settings.
What You'll Need
- Excel installed (Windows or Mac version)
- Access to the file containing your macro
- The macro name (check the original code or code window title)
- Administrator/owner access if macros were disabled by IT policy
Step-by-Step
-
Verify the macro exists
PressAlt+F11to open the VBA Editor. In the Project Explorer window (left panel), look for:- ThisWorkbook – if the macro runs when opening the file
- Personal.xlsb – if it’s saved in your personal workbook
- A module named after your file or
Module1
-
Check macro security settings
In Excel, go to:- File > Options > Trust Center > Trust Center Settings (Windows)
- Excel > Preferences > Security > Enable macros (Mac)
-
Add the macro to the list manually
If the macro appears in VBA but doesn’t show inView > Macros:- Press
Alt+F8to open the Macro dialog - Click Macros in the dropdown (if available)
- Select All to see hidden macros
- If your macro isn’t listed, use VBA to add it:
Sub AddMissingMacroToList() Dim wkb As Workbook Dim wbkPersonal As Workbook Set wkb = ThisWorkbook Set wbkPersonal = Workbooks("Personal.xlsb") 'or your workbook name Application.Macros.Add Name:="YourMacroName", Category:="Custom", Description:="" End Sub
- Press
-
Enable the personal macro workbook
ThePersonal.xlsbfile stores macros you mark as "personal." If it’s missing:- Open VBA Editor (
Alt+F11) - Go to Tools > References
- Check if Microsoft Excel Object Library and VBA Extensibility are enabled
- If
Personal.xlsbis missing, create it:Dim pb As Workbook Set pb = Workbooks.Add(Template:=ThisWorkbook.Path & "\Personal.xlsb")
- Open VBA Editor (
-
Rebuild the macro list cache
Sometimes Excel’s macro cache gets corrupted. To fix:- Close Excel completely (end all Excel processes in Task Manager or Activity Monitor)
- Delete the file:
- Windows:
%AppData%\Microsoft\Excel\XLSTART\ - Mac:
~/Library/Application Support/Microsoft/Office/User Templates/My Templates/
- Windows:
- Restart Excel and re-enable macros (as in Step 2)
Common Mistakes
Users often miss these hidden causes for missing macros:
- Macros saved in a different workbook – if you copied the code but didn’t save it to the right file, it won’t appear in the list
- Macro security disabled by IT – even if you enable macros, group policies may override this. Check with your admin.
- Typo in the macro name – VBA is case-sensitive when calling macros. Verify the exact name in the code editor.
- Running Excel in Safe Mode – some macros won’t load. Disable Safe Mode via
Excel.exe /safe(Command Prompt) - Corrupted workbook – if the file has errors, macros may fail to load. Test in a new blank workbook.
Tips
- Use the Macro Recorder to ensure your macro is saved in the right workbook. Go to
Developer > Record Macro(enable the Developer tab inFile > Options > Customize Ribbon) - Test macros in a blank workbook to isolate whether the issue is file-specific or Excel-wide.
- Check for add-ins interfering. Disable all add-ins (
File > Options > Add-ins > Go) and see if the macro appears. - Use shortcuts to run macros without opening the Macro dialog. Assign a keyboard shortcut via VBA:
Application.OnKey "^+M", "YourMacroName"
(This requires enabling macros and testing in a safe environment.) - Backup your Personal.xlsb before modifying it. It stores macros across workbooks.
Troubleshooting
If that did not work:
- Repair Excel installation
- Windows: Go to
Control Panel > Programs > Programs and Features > Excel > Change > Quick Repair - Mac: Reinstall via
Launchpad > Microsoft Excel > Reinstall
- Windows: Go to
- Check for conflicting updates
- Roll back the last Windows update or Excel update via
Settings > Windows Update > Update History - On Mac, check for Office updates (
Excel > Help > Check for Updates)
- Roll back the last Windows update or Excel update via
- Recreate the macro
- Open VBA (
Alt+F11), delete the existing macro code, then re-enter it - Save the workbook as a new file to ensure no corruption
- Open VBA (
- Use PowerShell/Cmd to force-enable macros (Windows only)
Run in Command Prompt (Admin):
reg add "HKCU\Software\Microsoft\Office\16.0\Excel\Options" /v EnableMacroMessageBox /t REG_DWORD /d 1 /f
(Replace16.0with your Office version number fromFile > Account > About Excel) - Contact support
If macros still don’t appear and none of the above works:
- Windows: Microsoft Support (select "Macros" as the issue)
- Mac: Apple Support (for Office for Mac)
- Excel version (from
File > Account) - OS version
- Steps you’ve already tried
Frequently Asked Questions
Why does my macro show up in VBA but not in the Macro list?
The macro list is generated by Excel’s internal cache, which sometimes fails. The fastest fix is to add it manually via VBA (Step 3) or delete the XLSTART folder (Step 5) to rebuild the cache.
Can I run a macro without enabling all macros?
Only if the macro is digitally signed or saved in Personal.xlsb. To test:
- Open VBA, locate your macro in
Personal.xlsb - Right-click the macro name > Run Sub/UserForm
- If it runs, it’s safe to mark it as "trusted" in Trust Center settings
How do I find out if my macro was deleted?
Check the file’s Version History (Windows) or Autosave (Mac) in File > Info. For VBA, look at the Project Explorer in the Editor (Alt+F11); deleted macros leave empty modules. You can recover them if the file wasn’t overwritten.
Why does my macro work in one file but not another?
This typically means:
- The macro is saved in the wrong workbook (e.g.,
ThisWorkbookvs. a module in another file) - Different macro security levels are applied to each file
- The second file has disabled VBA references (go to
Tools > Referencesin VBA)
Can I move a macro from one workbook to another?
Yes, but carefully:
- Copy the module code (select all code in the Editor, right-click > Copy)
- Open the target workbook, press
Alt+F11, right-click in the Project Explorer > Insert > Module - Paste the code into the new module
- If it’s a
ThisWorkbookmacro, recreate it in the new file’s VBA project
What if my macro is saved in a password-protected workbook?
You’ll need to:
- Open the file in Protected View (enable it in Excel Options > Trust Center > Protected View)
- Use VBA to extract the code (requires knowing the password):
Dim wb As Workbook Dim pwd As String Set wb = Workbooks.Open("YourFile.xlsx", , False, "YourPassword") - Copy the code to a new workbook without protection
- Save the new workbook and re-enable macros
File > Info > Protect Workbook > Remove Password (if the workbook was originally password-protected).