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

Friends,

I have written VBA code that loops through 150 workbooks and performs
various tasks on each workbook. One task I need to perform is deleting one
sheet in each workbook.

Problem is, the Excel Delete Sheet Warning message box appears before each
deletion, which means I need to manually confirm the deletion 150 times. Is
there a VBA way to turn off Excel's delete sheet warning (like there is in
Access)?

Thanks for your help ...

bill morgan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default VBA Bypass Delete Sheet Warning

something like this

Sub delsheet()

Application.DisplayAlerts = False
Worksheets("sheet3").Delete
Application.DisplayAlerts = True
End Sub

--


Gary


"bill_morgan" wrote in message
...
Friends,

I have written VBA code that loops through 150 workbooks and performs
various tasks on each workbook. One task I need to perform is deleting one
sheet in each workbook.

Problem is, the Excel Delete Sheet Warning message box appears before each
deletion, which means I need to manually confirm the deletion 150 times. Is
there a VBA way to turn off Excel's delete sheet warning (like there is in
Access)?

Thanks for your help ...

bill morgan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default VBA Bypass Delete Sheet Warning

application.displayalerts = false
sheets("Whatever").Delete
application.displayalerts = true
--
HTH...

Jim Thomlinson


"bill_morgan" wrote:

Friends,

I have written VBA code that loops through 150 workbooks and performs
various tasks on each workbook. One task I need to perform is deleting one
sheet in each workbook.

Problem is, the Excel Delete Sheet Warning message box appears before each
deletion, which means I need to manually confirm the deletion 150 times. Is
there a VBA way to turn off Excel's delete sheet warning (like there is in
Access)?

Thanks for your help ...

bill morgan


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default VBA Bypass Delete Sheet Warning

Hi Bill

You can use this

Application.DisplayAlerts = False
'Code
Application.DisplayAlerts = True


--
Regards Ron de Bruin
http://www.rondebruin.nl


"bill_morgan" wrote in message ...
Friends,

I have written VBA code that loops through 150 workbooks and performs
various tasks on each workbook. One task I need to perform is deleting one
sheet in each workbook.

Problem is, the Excel Delete Sheet Warning message box appears before each
deletion, which means I need to manually confirm the deletion 150 times. Is
there a VBA way to turn off Excel's delete sheet warning (like there is in
Access)?

Thanks for your help ...

bill morgan




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA Bypass Delete Sheet Warning


Sub ..
Application.DisplayAlerts = False
'your code here ...
Application.DisplayAlerts = True
End Su

--
davesexce
-----------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...fo&userid=3170
View this thread: http://www.excelforum.com/showthread.php?threadid=51742



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default VBA Bypass Delete Sheet Warning

Excellent. Thank you, Jim ...

"Jim Thomlinson" wrote:

application.displayalerts = false
sheets("Whatever").Delete
application.displayalerts = true
--
HTH...

Jim Thomlinson


"bill_morgan" wrote:

Friends,

I have written VBA code that loops through 150 workbooks and performs
various tasks on each workbook. One task I need to perform is deleting one
sheet in each workbook.

Problem is, the Excel Delete Sheet Warning message box appears before each
deletion, which means I need to manually confirm the deletion 150 times. Is
there a VBA way to turn off Excel's delete sheet warning (like there is in
Access)?

Thanks for your help ...

bill morgan


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default VBA Bypass Delete Sheet Warning

So simple! Thanks, Gary ...

"Gary Keramidas" wrote:

something like this

Sub delsheet()

Application.DisplayAlerts = False
Worksheets("sheet3").Delete
Application.DisplayAlerts = True
End Sub

--


Gary


"bill_morgan" wrote in message
...
Friends,

I have written VBA code that loops through 150 workbooks and performs
various tasks on each workbook. One task I need to perform is deleting one
sheet in each workbook.

Problem is, the Excel Delete Sheet Warning message box appears before each
deletion, which means I need to manually confirm the deletion 150 times. Is
there a VBA way to turn off Excel's delete sheet warning (like there is in
Access)?

Thanks for your help ...

bill morgan





  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default VBA Bypass Delete Sheet Warning

Thanks, Dave. Glad I asked ... so simple, but would have taken me awhile to
figure out.

"davesexcel" wrote:


Sub ..
Application.DisplayAlerts = False
'your code here ...
Application.DisplayAlerts = True
End Sub


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=517423


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default VBA Bypass Delete Sheet Warning

Thanks, Ron. Everybody giving me the same answer, so must be the BEST way ...


"Ron de Bruin" wrote:

Hi Bill

You can use this

Application.DisplayAlerts = False
'Code
Application.DisplayAlerts = True


--
Regards Ron de Bruin
http://www.rondebruin.nl


"bill_morgan" wrote in message ...
Friends,

I have written VBA code that loops through 150 workbooks and performs
various tasks on each workbook. One task I need to perform is deleting one
sheet in each workbook.

Problem is, the Excel Delete Sheet Warning message box appears before each
deletion, which means I need to manually confirm the deletion 150 times. Is
there a VBA way to turn off Excel's delete sheet warning (like there is in
Access)?

Thanks for your help ...

bill morgan





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
using VBA how can I delete a worksheet w/o the warning message pop Jim K.[_2_] Excel Discussion (Misc queries) 2 July 1st 08 04:00 PM
Why security warning still appear after I delete all macros Wei Kai Excel Worksheet Functions 1 February 8th 07 05:51 AM
What is the VBA code to delete a sheet without warning message? [email protected] Excel Discussion (Misc queries) 2 August 9th 05 04:16 PM
Delete sheet without warning messages Flystar[_17_] Excel Programming 1 May 31st 04 04:51 AM
Warning Statement to Delete Macro John M[_5_] Excel Programming 2 November 25th 03 04:09 PM


All times are GMT +1. The time now is 05:57 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"