Name

workbook.Names

Synopsis

Returns the Names collection containing all the names in the workbook. For example, the following code displays all of the names in a workbook, allowing you to delete them individually:

Dim nm As Name
For Each nm In ThisWorkbook.Names
    If MsgBox("Delete " & nm.Name & "?", vbYesNo) = vbYes Then _
      nm.Delete
Next

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.