Delete "Unused names" in a batch

G

Guest

Hi,

my excel sheet has 100s of unused names that I would like to delete
automatically. THere are also a range of hidden unused names which are not
visible in the regular Insert -> Name - Define.

Quick help would be much appreciated

Regards
Dieter
 
D

Dave Peterson

If you're working with names, get Jan Karel Pieterse's (with Charles Williams
and Matthew Henson) Name Manager:

You can find it at:
NameManager.Zip from http://www.oaltd.co.uk/mvp

Remember that just because you don't see the name used in a worksheet, doesn't
mean it's not used in any code.
 
G

Guest

Dave,

I used the version 4.0, however, in order to delete the unused names, the
tool requires to rename them individualy. It says that the name is "unusable"
and the next pop up states "Name cannot resemble a reference" and it requires
a new name. So, given the huge number, this is also rather cumbersome. Or do
I miss something in the tool?

I found some VB coding, which lists the unused names, however, my coding
know how is too limited in order to change it so that deleted them, too.

***********************
Sub ShowNames()
i = 1
For Each nm In ActiveWorkbook.Names
Cells(i, 1).Value = nm.Name
Cells(i, 2).Value = nm.RefersTo
Cells(i, 3).Value = nm.Visible
i = i + 1
ActiveWorkbook.Names(nm.Name).Delete
Next
End Sub
********************************

Regards
Dieter
 

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