Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Hiding, or automatically answering, a confirmation msgbox

In a macro I have, I create a new worksheet to do some work in and then
later in the macro, I delete the worksheet since it is no longer needed.
(There is another worksheet in this workbook that is always there when this
macro runs) When the macro sends the command to delete the worksheet, a
msgbox pops up telling me that there may be data in the worksheet I'm
deleting and am I sure that I want to delete it. I click on the "Delete"
button and the macro continues on its merry way.

How can I either get rid of the msgbox appearing, or put something in the
macro that will automatically select "Delete" on the msgbox so that there is
no interaction from the user required for the macro to finish running?

-Brian


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Hiding, or automatically answering, a confirmation msgbox

In your code to delet the sheet you need to insert:-

Application.DisplayAlerts = false

following this you then need the code to delete the sheet and then you
need to have:-

Application.DisplayAlerts = True

To turn the alerts back on again, otherwise you wont be alerted about
anything else which may happen in your sheet.

Hope this helps,
Mat
For Excel Tutorials and Tips: http://teachr.blogspot.com


Brian Beck wrote:
In a macro I have, I create a new worksheet to do some work in and then
later in the macro, I delete the worksheet since it is no longer needed.
(There is another worksheet in this workbook that is always there when this
macro runs) When the macro sends the command to delete the worksheet, a
msgbox pops up telling me that there may be data in the worksheet I'm
deleting and am I sure that I want to delete it. I click on the "Delete"
button and the macro continues on its merry way.

How can I either get rid of the msgbox appearing, or put something in the
macro that will automatically select "Delete" on the msgbox so that there is
no interaction from the user required for the macro to finish running?

-Brian


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
AUtomatically hiding a row when a certain cell is blank kirbster1973 Excel Discussion (Misc queries) 6 January 21st 08 04:47 PM
Automatically Hiding Blank Rows [email protected] Excel Discussion (Misc queries) 5 December 31st 05 04:13 PM
How do I stop an Excel sheet from automatically hiding rows when . kazyreed Excel Worksheet Functions 1 February 3rd 05 03:35 PM
hiding columns automatically dave glynn Excel Discussion (Misc queries) 2 February 1st 05 06:36 PM
hiding columns automatically dave glynn Excel Discussion (Misc queries) 0 February 1st 05 06:15 PM


All times are GMT +1. The time now is 09:43 PM.

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"