Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Delete Sheet in Code (2003)

    Is there a way to delete worksheets in VBA? I have tried the following with no success.

    With xlWrkbk
    .Sheets("Scratch").Select
    xlApp.ActiveWindow.SelectedSheets.Delete
    .Sheets("ScratchPivot").Select
    xlApp.ActiveWindow.SelectedSheets.Delete
    End With

    Any ideas are greatly appreciated.

    Ken

  2. #2
    5 Star Lounger
    Join Date
    Aug 2004
    Location
    Connecticut, USA
    Posts
    816
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete Sheet in Code (2003)

    <P ID="edit" class=small>(Edited by mbarron on 11-Oct-07 22:12. fixed typo)</P>Application.DisplayAlerts = False
    Worksheets("Sheet_Name").Delete
    Application.DisplayAlerts = True

  3. #3
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Delete Sheet in Code (2003)

    Ahah! So that is why it was 'beeping' when running the code.

    THANKS! ! I It worked GREAT!

Posting Permissions

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