View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default Delete a Sheet without dialog

Just to be safe you should probably add

Application.DisplayAlerts = False
on error resume next
Sheets("Replace Info").Delete
Application.DisplayAlerts = True

or add this line into an existing error handler if you have one
Application.DisplayAlerts = True

Otherwise if the delete fails then you never turn the alerts back on whcih
can be a bad thing...


"Mike Fogleman" wrote:

Application.DisplayAlerts = False
Sheets("Replace Info").Delete
Application.DisplayAlerts = True

Mike F

"Ken Loomis" wrote in message
...
I am using this to delete a worksheet:

Sheets("Replace Info").Delete

however, that causes a warning dialog box. How can I delete that worksheet
without a dialog box?