Delete Sheet

  • Thread starter Thread starter Dthmtlgod
  • Start date Start date
D

Dthmtlgod

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
 
When would you like the sheet deleted? It needs to be done on some
action (i.e. when a cell is selected, when the file is opened, etc.)
 
One way:

Application.DisplayAlerts = False
Sheets("wcexcel").Delete
Application.DisplayAlerts = True
 
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.
 
Hi, when you say deleting without user intervention do you mean without
having to respond to a prompt asking you if you want to delete the
sheet or cancel? If so, try this:

Application.DisplayAlerts = False
Sheets("wcexcel").Delete
Application.DisplayAlerts = True

HTH--Lonnie M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Delete Worksheets 4
Delete sheet code 1
Deleting sheets 3
Suppress Delete Sheet Warning 1
clear all sheets code 4
Delete Worksheets in same excel 4
Deleting a worksheet 4
Yet another undesired pop-up 8

Back
Top