• Bypassing the Delete Sheet Alert (2000 (9.0.4402 SR-1))

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Bypassing the Delete Sheet Alert (2000 (9.0.4402 SR-1))

    • This topic has 2 replies, 2 voices, and was last updated 22 years ago.
    Author
    Topic
    #386784

    I’m deleting worksheets from a workbook using VBA code:

    Sheets(“Sheet1”).Delete

    This generates an alert box asking if I really want to delete the sheet. No big deal, except when I’m trying to delete 30 or 40 sheets I get an alert for each one! I figure there must be a check box to disable this somewhere in the options, but I sure can’t find it. Anyone know of a way to bypass these alerts?

    Thanks.

    Viewing 0 reply threads
    Author
    Replies
    • #672510

      Before you issue the delete statements, insert APPLICATION.DISPLAYALERTS = FALSE, and after the deletions, reverse it with APPLICATION.DISPLAYALERTS = TRUE.

      HTH

    Viewing 0 reply threads
    Reply To: Bypassing the Delete Sheet Alert (2000 (9.0.4402 SR-1))

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: