Deleting a tab without getting a warning


Posted by Robert Yerby on October 03, 2001 8:10 AM

Does anybody know how to write the code to delete a tab (say Sheet1) without the code stopping at the messgae that warns that the tab will be permanently deleted?

Posted by Barrie Davidson on October 03, 2001 8:13 AM

Robert, this will work for you.

Sub Delete_sheet()
Application.DisplayAlerts = False
Sheets("Sheet1").Delete
Application.DisplayAlerts = True
End Sub


Regards,
BarrieBarrie Davidson



Posted by Dank on October 03, 2001 8:15 AM

Only through VBA - Application.DisplayAlerts=False.
in a macro but the alerts will be reset once the macro stops or once you set it back to True.

Regards,
Dan.