View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Delete broken named ranges in sheet

Hi Akyhne.

Try:

Sub DeleteBrokenNames()
Dim Nme As Name

For Each Nme In ActiveWorkbook.Names
If Right(Nme.RefersTo, 5) = "#REF!" Then
Nme.Delete
End If
Next Nme

End Sub



---
Regards,
Norman



"akyhne" wrote in message
...
How to delete broken named ranges in sheet?

When you manually delete rows or columns than contains named ranges, the
named ranges in the deleted area is not deleted, but remains with a faulty
reference as (Example): MYNAMEDRANGE =SHEETS!#REFERENCE!