ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to Finded Defined Names with #REF (https://www.excelbanter.com/excel-programming/286957-macro-finded-defined-names-ref.html)

Kay[_3_]

Macro to Finded Defined Names with #REF
 
Howdy
Is there a way that I could create a macro to find and
delete defined names that refer to #REF? I have over a
100 defined names in several workbooks that I need to
delete.
smiles
Kay

Chip Pearson

Macro to Finded Defined Names with #REF
 
Kay,

Try something like the following code:

Dim N As Excel.Name
For Each N In ThisWorkbook.Names
If InStr(1, "#REF", N.RefersTo) Then
N.Delete
End If
Next N


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Kay" wrote in message
...
Howdy
Is there a way that I could create a macro to find and
delete defined names that refer to #REF? I have over a
100 defined names in several workbooks that I need to
delete.
smiles
Kay





All times are GMT +1. The time now is 04:59 PM.

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