View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default How to delete Excel worksheet using VBA without delete dialog?

Hi cocalico22

You can use DisplayAlerts

Sub DeleteActiveSheet()
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"cocalico22" wrote in message ...
In my VBA macro, I delete a worksheet. A dialog displays asking if I really
want to delete the worksheet. The answer is always yes therefore I do not
want the user to have to click the Delete button so the macro can continue.
Is there any way to turn off this "feature"?