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

Excel 97 - VBA delete names?

6 views
Skip to first unread message

Chris Buck

unread,
Nov 25, 1999, 3:00:00 AM11/25/99
to
I am looking for a VBA routine to delete all the names in a workbook.

I can do names individually, eg: ActiveWorkbook.Names("fred").Delete

Can somebody tell me if it is possible to delete all names at a stroke?

Thanks


Rob Bruce

unread,
Nov 25, 1999, 3:00:00 AM11/25/99
to
Chris,

Run This:

Sub ZapNames()

Dim nmeAnyName As Name

For Each nmeAnyName In ActiveWorkbook.Names
nmeAnyName.Delete
Next

End Sub

HTH

--
Rob

www.rb-ad.dircon.co.uk/rob/excelvba/
Chris Buck <ch...@buczkowski.freeserve.co.uk> wrote in message
news:81k3a4$vrm$1...@newsg2.svr.pol.co.uk...

Patrick Molloy

unread,
Nov 26, 1999, 3:00:00 AM11/26/99
to
I don't think so IMHO

but the code is easy enough...

Sub Delete_Names()
Dim wb As Workbook
Set wb = ActiveWorkbook
Do While wb.Names.Count > 0: wb.Names(1).Delete: Loop
set wb = nothing
End Sub

0 new messages