Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Oct 2002
    Location
    Blue Mountains, New South Wales, Australia
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Suppressing prompt dialogs on deleting a workshee (XL 97/VBA)

    I have written the following code to delete a worksheet from a workbook if it exists. If the worksheet doesn't exist it will run perfectly. If it does exist, the macro prompts me whether I want to delete the worksheet. I do want to, since that is why I wrote the macro. How can I suppress the warning message?

    VBA follows...
    On Error Resume Next
    ActiveWorkbook.Worksheets("Raw_data").Delete
    On Error GoTo 0

  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Suppressing prompt dialogs on deleting a workshee (XL 97/VBA)

    Use Application.DisplayAlerts=False before you delete the sheet.

Posting Permissions

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