Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
using VBA how can I delete a worksheet w/o the warning message pop | Excel Discussion (Misc queries) | |||
Why security warning still appear after I delete all macros | Excel Worksheet Functions | |||
What is the VBA code to delete a sheet without warning message? | Excel Discussion (Misc queries) | |||
Delete sheet without warning messages | Excel Programming | |||
Warning Statement to Delete Macro | Excel Programming |