Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using this code snippet from Microsoft (that I modified slightly), I can
delete any and all defined names without errors. Any defined name that has a #REF! error, for example, cannot be deleted with the VBA. Is there any VBA code that will delete defined names with errors? Thanks! Mike Sub DELETE_VISIBLE_Names() ' Dimension variables. Dim xName As Variant Dim Result As Variant Dim Vis As Variant ' Loop once for each name in the workbook. For Each xName In ActiveWorkbook.Names 'If a name is not visible (it is hidden)... If xName.Visible = True Then Vis = "Visible" Else Vis = "Hidden" End If If Vis = "Visible" Then xName.Delete ' Loop to the next name. Next xName End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selectively Delete Defined Names | Excel Programming | |||
Delete defined names | Excel Discussion (Misc queries) | |||
delete defined names | Excel Programming | |||
How to delete all defined names from a workbook? | Links and Linking in Excel | |||
Macro to delete Defined Names | Excel Programming |