Phantom named ranges in a workbook?

D

Dave O

As an exercise I ran this code on a spreadsheet I've been using for
several years, which has been updated through several Excel releases.
It shows 76 named ranges, mostly starting with "HTML_" ; I have used
this file to manipulate data copied and pasted from web pages. The
..RefersTo shows a mix of values assigned and cell references. When I
click ~Insert ~Name ~Define, however, only one named range appears in
the list.

How does this spreadsheet have named ranges that do not appear in the
Name Define list?

Thanks- the code follows:

Sub Named_Range_Show()
Dim NamedRange As Variant
For Each NamedRange In ActiveWorkbook.Names
MsgBox NamedRange.Name & ": " & NamedRange.RefersTo
Next NamedRange
End Sub
 
B

Bob Umlas

Names can be hidden.
Activeworkbook.Names("XYZ").Visible = False
would hide the name.
Run this code to unhide them:
Sub UnhideNames()
For each Nme in Activeworkbook.Names
Nme.Visible = True
Next
End Sub

Bob Umlas
Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top