Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Excel names in workbook - how to delete all?

47 views
Skip to first unread message

GOH

unread,
May 19, 2008, 6:07:02 AM5/19/08
to
How do you delete all the 'names' defined @ workbook? I can only do it 1 at
time now using 'Insert'-'Name'-'Define'......however, I have hundreds of them
(accumlated unknowingly, when I copied 3rd party worksheet - it seem that the
names juz get copied over each time you copy from another file).

Thanks.

Max

unread,
May 19, 2008, 6:16:00 AM5/19/08
to
Sub DeleteNames()
Dim nm As Object
For Each nm In ActiveWorkbook.Names
nm.Delete
Next
End Sub

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---

Bob Phillips

unread,
May 19, 2008, 7:25:27 AM5/19/08
to
Sub DeleteNames()
Dim nme As Name

For Each nme In ActiveWorkbook.Names
If nme.Name Like "*_FilterDatabase" Or _
nme.Name Like "*Print_Area" Or _
nme.Name Like "*Print_Titles" Or _
nme.Name Like "*wvu.*" Or _
nme.Name Like "*wrn.*" Or _
nme.Name Like "*!Criteria" Then
Else
nme.Delete
End If
Next nme

End Sub

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)

"GOH" <G...@discussions.microsoft.com> wrote in message
news:7064FCCB-3C29-430A...@microsoft.com...

Pete_UK

unread,
May 19, 2008, 7:57:52 AM5/19/08
to
You can type this little routine into the immediate window - Alt_F11
to bring up the VBE, then CTRL-G to get the Immediate Window, then
type:

For Each n In ActiveWorkbook.Names : n.Delete : Next n

Press <Enter> at the end of the line, and all your names will be
deleted.

Hope this helps.

Pete

Bruce Sinclair

unread,
May 21, 2008, 12:30:24 AM5/21/08
to

If you work with names a bit, try the name manager add on. Google suggests
http://www.jkp-ads.com/officemarketplacenm-en.asp

HTH

0 new messages