+ Reply to Thread
Results 1 to 4 of 4

VBA for deleting a sheet

  1. #1
    Mike
    Guest

    VBA for deleting a sheet

    I am using the following code to delete a sheet within Excel:

    ActiveWindow.SelectedSheets.Delete

    Problem is, it is prompting the user to see if it is okay to delete. In
    every scenario of this macro, it will be okay to delete, so how can I bypass
    this message?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Mike,

    Application.DisplayAlerts = False
    ActiveWindow.SelectedSheets.Delete
    Application.DispalyAlerts = True

    Sincerely,
    Leith Ross

  3. #3
    Norman Jones
    Guest

    Re: VBA for deleting a sheet

    Hi Mike,

    Try:

    Application.DisplayAlerts = False
    ActiveWindow.SelectedSheets.Delete
    Application.DisplayAlerts = True

    ---
    Regards,
    Norman



    "Mike" <Mike@discussions.microsoft.com> wrote in message
    news:F3709A0A-818B-4204-9467-F98CA739645E@microsoft.com...
    >I am using the following code to delete a sheet within Excel:
    >
    > ActiveWindow.SelectedSheets.Delete
    >
    > Problem is, it is prompting the user to see if it is okay to delete. In
    > every scenario of this macro, it will be okay to delete, so how can I
    > bypass
    > this message?




  4. #4
    Mike
    Guest

    Re: VBA for deleting a sheet

    thanks to both of you

    "Leith Ross" wrote:

    >
    > Hello Mike,
    >
    > Application.DisplayAlerts = False
    > ActiveWindow.SelectedSheets.Delete
    > Application.DispalyAlerts = True
    >
    > Sincerely,
    > Leith Ross
    >
    >
    > --
    > Leith Ross
    > ------------------------------------------------------------------------
    > Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
    > View this thread: http://www.excelforum.com/showthread...hreadid=487372
    >
    >


+ 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