Thread: Delete Sheet
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Delete Sheet

The answer to your question depends on when you need the sheet deleted. If
no user intervention, the routine needs some way to know it is time to delete
- so when is that? For example, if you want it to delete when the user
closes the workbook, you would put the code in the Workbook_BeforeClose event
procedure.

On another topic - to simplify the code further:
Sheets("wcexcel").Delete

"Dthmtlgod" wrote:

I have this code to delete the sheet. Pretty simple. How can I have it
delete the sheet without any user intervention?

Sheets("wcexcel").Select
ActiveWindow.SelectedSheets.Delete