Delete names

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
 
B

Bob Phillips

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)
 
G

Guest

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
 
B

Bob Phillips

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)
 
Top