sturdybits

Guides / Break Links

How to find and delete hidden names in Excel

30 November 2026

Excel's Name Manager doesn't list hidden names, so you need a short macro to bring them into view. Run it to make the hidden names visible, then open Formulas > Name Manager, check what each one refers to, and delete the ones that point to another file or to #REF!. Work on a copy of the workbook, and leave Excel's own names alone.

Why hidden names cause trouble

A defined name is a label for a cell, range or formula, such as TaxRate for Settings!$B$2. Each name can be visible or hidden, and Microsoft's Name Manager help says hidden names aren't displayed. There's no button in Excel to hide a name: add-ins, macros and other programs do it. Solver, for example, saves its settings as hidden names.

Names also travel. When you copy or move a sheet into another workbook, Excel brings the names its formulas use along with it, and a copied name can end up pointing back at the old file. That causes two common problems:

1. Check whether the workbook has hidden names

Good for: a quick answer without a macro, in Excel for Windows.

Save a copy of the workbook and open the copy. Choose File > Info > Check for Issues > Inspect Document, then Inspect. If there are hidden names, the results say so. Microsoft's hidden names help confirms the Document Inspector can't remove them for you.

Don't choose Remove All next to the other results unless you mean to: Microsoft warns that removed content may not come back with Undo.

2. Look at the visible names first

Good for: names you can already see.

Choose Formulas > Name Manager. Click the Refers To heading to sort the list, and look for:

Choose Filter > Names With Errors to show only names whose value is an error, such as #REF!.

3. Unhide the hidden names with a macro

Good for: seeing everything Name Manager leaves out, in Excel for Windows or Mac.

This macro makes every hidden name in the active workbook visible, except names that start with an underscore. Those are almost always Excel's own, such as _FilterDatabase, which Excel uses for filters, and names starting _xlfn., which relate to newer functions.

Sub UnhideNames()
    Dim n As Name, shortName As String
    For Each n In ActiveWorkbook.Names
        shortName = Mid(n.Name, InStrRev(n.Name, "!") + 1)
        If n.Visible = False And Left(shortName, 1) <> "_" Then n.Visible = True
    Next n
End Sub

Names that belong to one sheet start with the sheet name, as in Sheet1!_FilterDatabase, so the macro checks the part after the !.

To run it:

  1. Open your copy of the workbook and make sure it's the active window.
  2. Open the VBA editor: press Alt+F11 on Windows, or choose Developer > Visual Basic on a Mac. If there's no Developer tab, turn it on in Excel's Ribbon & Toolbar settings.
  3. Choose Insert > Module, paste the macro in, click inside it and choose Run > Run Sub/UserForm. On Windows, F5 does the same.
  4. Close the editor and open Name Manager again. The hidden names are now listed with the rest.

This works in an .xlsx file. When you save, Excel warns that the VB project can't be saved in a macro-free workbook: choose Yes, and the file is saved without the macro. The names stay visible.

4. Delete names safely

Good for: clearing out old links and #REF! names.

A formula that uses a deleted name shows #NAME?, so check each name before you delete it.

  1. Press Ctrl+F (Cmd+F on a Mac) and choose Options. Set Within to Workbook and Look in to Formulas, type the name and choose Find All. No results means no cell formula uses it.
  2. Find only searches cells. Names can also be used in conditional formatting rules, data validation lists, charts and other names, so check those for any name you're unsure about.
  3. In Name Manager, select the names to delete. Hold Ctrl to pick several, or Shift to pick a run of them. Choose Delete, then OK.
  4. Save, close and reopen the workbook. If Excel still asks to update links, or Data > Workbook Links still lists the old file, the link is hiding somewhere else as well (see the next section).

Leave these alone unless you know you don't need them:

If you'd rather delete from VBA, Microsoft's hidden names help has a longer macro that shows each name and what it refers to, and asks whether to delete it.

When the names point to other files

If you're hunting hidden names because of a link that won't go away, names may not be the only place it's hiding. Conditional formatting, data validation, charts and pivot tables can hold links too, and our guide to Excel break links not working covers each one.

Break Links finds them without a macro. It lists every name that points to another file, hidden or not, along with the links in cell formulas, conditional formatting, data validation and charts. Then it downloads a clean copy with those links removed, and your original isn't touched. It only removes names that refer to another file: names that just say #REF!, and Solver's names, are left for you to tidy with the steps above. It runs in your browser on Windows or Mac, and the file never leaves your computer. Finding links is free for any workbook; the free version removes links from up to 10 places, and Pro is £15 once. You can try it with a sample workbook.

Quick answers

Why can't I see a name in Name Manager? It's hidden. Name Manager doesn't list hidden names. Make them visible with the macro above and they appear in the list.

How do I delete all hidden names in Excel? Unhide them with the macro, then select them in Name Manager and choose Delete. Check first that nothing uses them, and keep Excel's own names and any that Solver or an add-in needs.

Can I delete a name that refers to #REF!? Yes, once you've checked that no formula uses it. Filter > Names With Errors in Name Manager lists them.