Article ID: 153454
Article Last Modified on 8/17/2005
' This procedure deletes every named range in which the RefersTo
' argument contains #REF!, where #REF! begins at the second character
' and ends at the fifth.
Sub Delete_Every_Named_Range_With_A_Reference_Error()
Dim nm As Object
Dim mystr As String
' Loops through each name in the active workbook.
For Each nm In ActiveWorkbook.Names
' Check for #REF! in the defined name reference.
If InStr(1, nm.RefersTo, "#REF!") Then
' Delete the defined name if it is a match.
nm.Delete
End If
Next
End Sub
Additional query words: 5.00a 5.00c 7.00a 8.00 XL98 XL97 XL7 XL5 howto how to XL
Keywords: kbhowto kbprogramming kbdtacode KB153454