VBA Bypass Delete Sheet Warning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
something like this

Sub delsheet()

Application.DisplayAlerts = False
Worksheets("sheet3").Delete
Application.DisplayAlerts = True
End Sub
 
application.displayalerts = false
sheets("Whatever").Delete
application.displayalerts = true
 
Hi Bill

You can use this

Application.DisplayAlerts = False
'Code
Application.DisplayAlerts = True
 
Sub ..
Application.DisplayAlerts = False
'your code here ...
Application.DisplayAlerts = True
End Su
 
So simple! Thanks, Gary ...

Gary Keramidas said:
something like this

Sub delsheet()

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