Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel 2003 deleting group of defined names 4

Status
Not open for further replies.

Starlitnight

Technical User
May 2, 2006
20
US
Hello,
Is there a fast way to delete defined names in an excel worksheet? I'd rather not go line by line in the defined name dialog box. Is there another way I can delete groups of defined names? They all start with "act".
 
The only way I can figure to delete several at a time is via VBA.

Code:
Do Until ActiveWorkbook.Names.Count = 0
ActiveWorkbook.Names(1).Delete
Loop

Otherwise you could select the first name in the group, press delete, then press the down arrow key, then delete again. Just keep alternating between [Down Arrow] and [Delete]. This would go pretty quickly - especially if you are a drummer. ;-)

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Hi John,
thanks for the post! The only problem is that there are defined name I actually do want to keep. I was hoping for a something such as "if defined name = "act"&"*" but guess I'm not that lucky....I knew I should've been a drummer!
 



Hi,

The Name includes the SheetName...
Code:
    Dim nm As Name
    For Each nm In ThisWorkbook.Names
        MsgBox Split(nm.Name, "!")(1)
    Next

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
I was hoping for a something such as "if defined name = "act"&"*" ...

Look at Skip's code, and change it to look at the first 3 characters of each name ( using Left function ), and if it's "Act" then delete the name.

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
I think Jan's free Name Manager addin will let you do what you want:-


Click on the link thats ays 'Jan Karel Pieterse' and then download the 'Name Manager' file.

Regards
Ken............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top