Results 1 to 3 of 3

Data may exist in the sheet(s) selected for deletion

This is a discussion on Data may exist in the sheet(s) selected for deletion within the Excel Questions forums, part of the Question Forums category; All right, this is a very simple macro. Sheets("Sheet3").Select ActiveWindow.SelectedSheets.Delete However, right after I run this macro, a prompt appears: ...

  1. #1
    New Member
    Join Date
    May 2005
    Posts
    29

    Default Data may exist in the sheet(s) selected for deletion

    All right, this is a very simple macro.

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

    However, right after I run this macro, a prompt appears:

    "Data may exist in the sheet(s) selected for deletion. To permanently delete the data, press Delete."

    Is there a way to remove this dialog box by adding an automatic reply for this prompt?

    I am 100% sure that it is perfectly safe to delete it.

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Tasmania
    Posts
    58

    Default

    Hi

    Yes (This prevents the dialog box from appearing)
    Code:
    Application.DisplayAlerts = False
    Sheets("Sheet3").Select
    ActiveWindow.SelectedSheets.Delete
    Application.DisplayAlerts = True
    Fred

  3. #3
    New Member
    Join Date
    May 2005
    Posts
    29

    Default

    Hi

    Yes (This prevents the dialog box from appearing)
    Code:
    Application.DisplayAlerts = False
    Sheets("Sheet3").Select
    ActiveWindow.SelectedSheets.Delete
    Application.DisplayAlerts = True
    Fred
    You're a natural genius! Thank you very, very much!

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com