DELETING NAMED CELLS IN A SELECTION
MZ Tools makes life easier for the Excel VBA coder
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: DELETING NAMED CELLS IN A SELECTION

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    OKC
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I can delete all of the named cells with the below code, but i want to delete the named cells of a selected range that I choose only. Please help.

    sub deleteallnames ()
    dim nm as name
    for each nm in names
    nm.delete
    next
    end sub




  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Eddy


    Try this

    Sub deleteallnames()
    Dim nm As Name
    On Error Resume Next
    For Each nm In Names

    If Not Intersect(Range(nm.Name), Selection) _
    Is Nothing Then nm.Delete
    Next nm

    On Error GoTo 0
    End Sub


  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    OKC
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    works great....thanks!!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com