How to delete all names in xl workbook

SerenityNet

Registered User.
Local time
Today, 01:57
Joined
May 6, 2003
Messages
27
I can do something like
    ActiveWorkbook.Names("auto_open").Delete
for each name in my workbook. But I have a bunch of names. I've tried several methods to delete them all at once (like array...), but without success.

How can I just delete all names in the active workbook?

Thanks in advance,
Andrew
 
Wouldn't this be best posted in the Excel section?

Anyway, try this:
Sub DeleteRangeNames()
Dim nme As Name

  For Each nme In ActiveWorkbook.Names
    nme.Delete
  Next nme

End Sub
 
Thanks

Thanks. :D That did it perfectly.

Since it was a VBA sub I was looking to find, I put it here in the VBA forum without thinking about the application. Thanks for helping out anyway.

Andrew
 

Users who are viewing this thread

Back
Top Bottom