Excel - automatically deleting a worksheet (without warning prompt)

Asked By Guerilla on 21-Apr-07 12:29 PM
Hi,

A macro I use deletes a sheet tab, however, it prompts me to confirm
the deletion of the sheet.  How can I remove this prompt so the macro
runs without any user interaction?

Matt




urke replied on 21-Apr-07 01:02 PM
I think you can use this:

Sub delSheet()

Application.DisplayAlerts = False
Application.Sheets(1).Delete

End Sub


--
urkec
JMay replied on 21-Apr-07 03:15 PM
Add these 2 lines to your macro:

Application.Displayalerts = False '<<<< here
worksheets("TempData").Delete
Application.Displayalerts = True   ' <<< and here

HTH
Guerilla replied on 21-Apr-07 04:07 PM
Both answers worked, thank you very much.

Matt