ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete cell names (https://www.excelbanter.com/excel-programming/380975-re-delete-cell-names.html)

Gary Keramidas

Delete cell names
 
give this a try

Sub remove_bad_ranges()
Dim nm As Name
On Error Resume Next
For Each nm In ThisWorkbook.Names
If InStr(1, Range(nm).Address, "#REF") Then
nm.Delete
End If
Next
End Sub


--


Gary


"René" wrote in message
...
Hello,

In a workbook I deleted a lot of sheets. But on these sheets there were a
lot of cell names. These cell names still exist in the workbook, but of
course there's no reference anymore.
Is there an easy way to delete these unreferenced cell names?

Greetings
René





All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com