• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Deleting Excel named ranges

Brijesh

Member
Hi

I have a workbook in which there are some tables defined as named ranges. These names are Table1, Table2..... TableN (N being variable). I have written following code:

Range("Table" & *).Name.Delete

It's giving error. What code should I use?

Thanks
Brijesh
 
First, Pls don't start new thread for same query! I have deleted another one.

here's two loop for your info..

Code:
Dim n As Name
With ActiveWorkbook
    For Each n In .Names
        If n.Name Like "Table*" Then n.Delete
    Next
End With


Dim i As Integer
With ActiveWorkbook
    On Error Resume Next
        For i = 1 To .Names.Count
            .Names("Table" & i).Delete
        Next
    On Error GoTo 0
End With
 
Back
Top