ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   purge all names (https://www.excelbanter.com/excel-programming/346533-purge-all-names.html)

Henrik

purge all names
 
Hi,

I have inherited a workbook with more than 10k defined names, most of which
refer to broken external references. I would like to purge my workbook once
for all of all these links.

I downloaded a utility from http://www.jkp-ads.com/

which is ok. However, I think it would be much easier to simply write a
macro to do the job. I tried the following, which does not work. What am I
doing wrong?


Sub DeleteNames()

For Each nme In ActiveWorkbook.Names

nme.Delete

Next nme

End Sub




In advance, thanks for your help!



Norman Jones

purge all names
 
Hi Henrik,

Try:

'==========
Public Sub TestIt()
Dim nme As Name
For Each nme In ActiveWorkbook.Names
nme.Delete
Next nme
End Sub
'<<==========


---
Regards,
Norman



"Henrik" wrote in message
...
Hi,

I have inherited a workbook with more than 10k defined names, most of
which
refer to broken external references. I would like to purge my workbook
once
for all of all these links.

I downloaded a utility from http://www.jkp-ads.com/

which is ok. However, I think it would be much easier to simply write a
macro to do the job. I tried the following, which does not work. What am I
doing wrong?


Sub DeleteNames()

For Each nme In ActiveWorkbook.Names

nme.Delete

Next nme

End Sub




In advance, thanks for your help!






All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com