Mass deletion of block names

D

danhattan

I manage a large, complex spreadsheet that tracks statistical information for
several of our operations centers. It's been in existence since the mid 90's
and as our company structure has evolved so has the spreadsheet.

My problem is that there are now roughly 2000 named blocks in the
spreadsheet, although many reference areas of the spreadsheet no longer used.

Is there a way to delete several hundred defined block names in a single
stroke. I'm relatively fluent in VBA so there's a coding solution I'm open to
it.

Thanks in advance for any help.
 
D

Don Guillett

To just delete the bad ones try this. For ALL use n.delete (be CAREFUL what
you ask for)

Sub donames()
For Each n In Names
If InStr(n, "#REF") > 0 Then n.Delete 'MsgBox n
Next
End Sub
 
Top