+ Reply to Thread
Results 1 to 3 of 3

deleting worksheets from names in a range

  1. #1
    Jenn
    Guest

    deleting worksheets from names in a range

    Is there anyway to delete worksheets via code where one worksheet contains a
    range with the names of the tabs on the worksheets I want to delete?
    i.e., Sheet 1 has a range that has the values, A, B, C.
    These are the names on tabs for 3 worksheets. I want to have code that says
    "delete worksheets with the tabs named A, B, C.
    Let me know if you need more info.
    TIA!

  2. #2
    Bob Phillips
    Guest

    Re: deleting worksheets from names in a range


    With Worksheets("Sheet1")
    Application.DisplayAlaerts = False
    For i = 1 To Cells(Rows.Count,"A").End(xlUp).Row
    On Error Resume Next
    Worksheets(Cells(i,"A").Value).Delete
    On Error Goto 0
    Next i
    Application.DisplayAlerts = True
    End With

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Jenn" <[email protected]> wrote in message
    news:[email protected]...
    > Is there anyway to delete worksheets via code where one worksheet contains

    a
    > range with the names of the tabs on the worksheets I want to delete?
    > i.e., Sheet 1 has a range that has the values, A, B, C.
    > These are the names on tabs for 3 worksheets. I want to have code that

    says
    > "delete worksheets with the tabs named A, B, C.
    > Let me know if you need more info.
    > TIA!




  3. #3
    CyberTaz
    Guest

    Re: deleting worksheets from names in a range

    Why not just Ctrl+Click the tabs and use Edit>Delete Sheet?

    Regards |:>)




    On 8/22/05 5:08 PM, in article
    [email protected], "Jenn"
    <[email protected]> wrote:

    > Is there anyway to delete worksheets via code where one worksheet contains a
    > range with the names of the tabs on the worksheets I want to delete?
    > i.e., Sheet 1 has a range that has the values, A, B, C.
    > These are the names on tabs for 3 worksheets. I want to have code that says
    > "delete worksheets with the tabs named A, B, C.
    > Let me know if you need more info.
    > TIA!



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1