![]() |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 04:42 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com