Removing hidden names with invalid names in Excel 2003

I am using this macro:

http://support.microsoft.com/kb/119826

to try to clear hidden names in my excel file. It works for most hidden names, but not for several _123Graph names. I'm not sure where these names came from, but when I try to delete them, I get automation error 1004.

The knowledge base mentions that names with spaces can cause an error. Is there any way to remove them?

+3
source share
2 answers

Excel 2007 and above solves this problem ... but a quick fix for Excel 2003:

"" - - "" - R1C1 "".

.

... R1C1.

+2

, , , , , Excel .., .

, , .. .

: , .

Sub deleteNamedRanges()
    Dim n As Name
    Dim a As Variant

    For Each n In ThisWorkbook.Names

        a = MsgBox("Do you want to delete the following name?:" & vbCrLf & vbCrLf & n.Name & " (" & n.RefersTo & ")", vbYesNo, "Delete ranges")
        If a = vbYes Then
            n.Delete
        End If
    Next n
End Sub

, .

+2

Source: https://habr.com/ru/post/1760407/


All Articles