Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2001
    Location
    USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete Sheet Macro (Excel 97)

    Hello! I have created an easy macro that deletes a worksheet but how do I have it automatically answer "YES" to delete the sheet? Currently the macro stops and I have to click Yes.

    ActiveWindow.SelectedSheets.Delete

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Delete Sheet Macro (Excel 97)

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

    Steve

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Delete Sheet Macro (Excel 97)

    See if this helps:

    Application.DisplayAlerts = False
    ActiveWindow.SelectedSheets.Delete
    Application.DisplayAlerts = True
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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