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

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?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Delete a Sheet without dialog

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?





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Delete a Sheet without dialog

Thanks. That worked great.


"Mike Fogleman" wrote in message
...
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?







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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Delete a Sheet without dialog

Ken

Surround with

Application.DisplayAlerts = False

Sheets("Replace Info").Delete

Application.DisplayAlerts = True


Gord Dibben Excel MVP

On Thu, 24 Mar 2005 14:38:05 -0800, "Ken Loomis" wrote:

I am using this to delete a worksheet:



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





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
How to delete the "Insert Function Dialog Box" (dialog box only)? TBI''d biker Excel Worksheet Functions 2 April 7th 07 09:18 PM
changing options in delete dialog box marthann Excel Discussion (Misc queries) 1 March 23rd 06 09:16 PM
Disable Worksheet Delete Dialog Greg Excel Programming 1 March 1st 05 08:32 PM
Dialog sheet / Checkboxes Michael Beckinsale Excel Programming 3 January 18th 05 04:19 PM
Dialog Sheet not updating Macroman Excel Programming 0 November 27th 03 09:13 PM


All times are GMT +1. The time now is 04:43 AM.

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

About Us

"It's about Microsoft Excel"