Sub DeleteSheet ()
If Worksheets.Count 1 Then
Application.DisplayAlerts = False
Sheet1.Delete
Application.DisplayAlerts = True
Else
Msgbox("You can't delete the last Sheet!")
Exit Sub
End If
End Sub
A lowercase keyword usually means it is not recognized as belonging to the
object with which it is being used. If the command works as intended, then I
am not sure.
Mike F
"Jean-Pierre Bidon" wrote in message
...
Hi,
I'd like to delete a worksheet silently, but Excel asks for a
confirmation, because the sheet is possibly not empty. I tried to clear or
delete its usedrange beforehand, but it doesn't work neither (still asks
for confirmation).
My question: How to bypass this automatic request. By the way, I don't
understand that in the VB editor, "delete", the "d" is written in
lowercase.
Thanks in advance.
--
Jean-Pierre Bidon
Interstat
91 rue de Rennes
75006 Paris
Tél: 01 45 49 19 17