bleeg10
10-09-2007, 01:49 PM
Hi guys,
How do I delete hidden name ranges? The following code below unhides the hidden name ranges, but it won't delete them! I have to manually delete them one by one, and it's annoying. If you run the macro on the attached file, you get an error message. Please help me!
Sub Remove_Hidden_Names()
' Dimension variables.
Dim xName As Variant
' Loop once for each name in the workbook.
For Each xName In ActiveWorkbook.Names
If xName.Visible = True Then
xName.Delete
Else
xName.Visible = True
xName.Delete
End If
Next xName
End Sub
How do I delete hidden name ranges? The following code below unhides the hidden name ranges, but it won't delete them! I have to manually delete them one by one, and it's annoying. If you run the macro on the attached file, you get an error message. Please help me!
Sub Remove_Hidden_Names()
' Dimension variables.
Dim xName As Variant
' Loop once for each name in the workbook.
For Each xName In ActiveWorkbook.Names
If xName.Visible = True Then
xName.Delete
Else
xName.Visible = True
xName.Delete
End If
Next xName
End Sub