Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Delete Sheet

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Delete Sheet

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.)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Delete Sheet

One way:

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

In article ,
"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

  #4   Report Post  
Posted to microsoft.public.excel.programming
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




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Delete Sheet

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.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Delete Sheet

Yah, like JE McGimpsey said... :)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete ROW on Sheet#1 corupts data on Sheet#2 Duane Excel Worksheet Functions 4 February 11th 10 07:53 PM
Delete values in sheet 2 that arre found in sheet 1 np Excel Discussion (Misc queries) 1 December 10th 09 07:21 PM
Delete rows from one sheet containing deatils on the second sheet [email protected] New Users to Excel 4 September 6th 07 11:10 AM
How do I un-delete a sheet? mdorn Excel Discussion (Misc queries) 2 February 4th 05 01:47 AM
delete sheet Esau[_2_] Excel Programming 1 September 15th 04 07:10 PM


All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"