Delete names

  • Thread starter Thread starter Meme
  • Start date Start date
M

Meme

Hi ,

I created a macro to download data from .prn files to my
worksheet A , then query the data and copy-past the
results to worksheet B. Every time after running my macro
it created hundreds of names with the pattern like :
externaldata-34
externaldata-35
......
and all the way to externaldata-569!!!!!! I am so
frustrated with all this names. Any one can give me some
suggestions on how to get rid of this ????????
Please help ! Thanks so much!

Meme
 
Run some code

Dim nme As Name

For Each nme In ActiveWoekbook.Names
If Left(nme.Name,8) = "external" Then
nme.Delete
End If
Next nme

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks Bob for your response. However the name
like "external..." didn't get moved from the name lists
by the code, should I make some adjustments before copy-
paste your code to my macro ?
Thanks a lots.
Meme
 
Meme,

There was a typo in the code I gave you. Give this a try instead

For Each nme In ActiveWorkbook.Names
If Left(nme.Name, 8) = "external" Then
nme.Delete
End If
Next nme

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Back
Top