Deleting Defined Names

Todd Bardoni

Well-known Member
Joined
Aug 29, 2002
Messages
3,042
Why is it so difficult to delete defined names. It seems as though the code below should work perfectly, but it does not. Any input?

Code:
    For i = 1 To 1000
        ActiveWorkbook.Names("ExternalData_" & i).Delete
    Next i
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
How about this?
Code:
Sub KillNames()
Dim x As Name
For Each x In Names
x.Delete
Next x
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,118,432
Messages
5,572,072
Members
412,437
Latest member
PietTheijssen
Top