I have many excel files that have bad hidden named ranges (old files I'm trying to clean up for folks). I have tried all of the 'delete range names' suggestions, but I still keep running across a named range called "=#NAME?" - and so the code bombs at this point and nothing is deleted.
the last one I tried was this, where the error was oName= "=#NAME?"
Any help is much appreciated.
Sub DeleteHiddenNames()
Dim oName As Name
For Each oName In ActiveWorkbook.Names
If Not oName.Visible Then oName.Delete
Next oName
End Sub
the last one I tried was this, where the error was oName= "=#NAME?"
Any help is much appreciated.
Sub DeleteHiddenNames()
Dim oName As Name
For Each oName In ActiveWorkbook.Names
If Not oName.Visible Then oName.Delete
Next oName
End Sub