How to delete a hundred range names at once?

D

Dima

Hello!
How to select many names in the "Define Name" window in Excel 2003 sp3 to
delete them? I unintentionally copied a thousand range names into a workbook
when copied a sheet from another workbook.
or, How to delete a hundred range names at once?
Regards,
Dmitry
 
M

Mike H

Hi,

Right click any sheet tab, view code and paste this in and run it. Note it
will delete all names in your workbook.

Sub delnames()
Dim nm As Name
On Error Resume Next
For Each nm In ActiveWorkbook.Names
nm.Delete
Next
On Error GoTo 0
End Sub

Mike
 

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