Wednesday 14 February 2018

How to delete all named ranges in Excel | Remove named range in Excel VBA


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