Sometimes you have to remove the named ranges from your Excel file, on such scenarios like copy pasted from another workbook or project scope is changed , etc.
It's a tedious task to remove the range names manually.
You can use below code to easily remove all named ranges in Excel file.
Sub RemoveNamedRanges()
nm As Name
On Error Resume Next
For Each nm In ActiveWorkbook.Names
nm.Delete
Next
On Error Goto 0
End Sub
No comments:
Post a Comment