+ Reply to Thread
Results 1 to 3 of 3

What is the VBA code to delete a sheet without warning message?

  1. #1
    slingsh0t@hotmail.com
    Guest

    What is the VBA code to delete a sheet without warning message?

    I have the following code to delete a tab:

    Sheets("Sheet1").Select
    ActiveWindow.SelectedSheets.Delete

    When I run this, I get the standard "You may lose data" warning
    message. Does a different syntax allow me to delete the sheet without
    getting the warning message?

    Thanks


  2. #2
    Dennis
    Guest

    RE: What is the VBA code to delete a sheet without warning message?


    Application.DisplayAlerts = False
    Sheets("Your Sheet").Delete
    Application.DisplayAlerts = True

    HTH Dennis


    "slingsh0t@hotmail.com" wrote:

    > I have the following code to delete a tab:
    >
    > Sheets("Sheet1").Select
    > ActiveWindow.SelectedSheets.Delete
    >
    > When I run this, I get the standard "You may lose data" warning
    > message. Does a different syntax allow me to delete the sheet without
    > getting the warning message?
    >
    > Thanks
    >
    >


  3. #3
    slingsh0t@hotmail.com
    Guest

    Re: What is the VBA code to delete a sheet without warning message?

    Thanks!


+ 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