using VBA how can I delete a worksheet w/o the warning message pop

  • Thread starter Thread starter Jim K.
  • Start date Start date
J

Jim K.

using VBA how can I delete a worksheet without having the warning message
popup "Data may exist in the sheet(s) ..."? I'm using
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Delete
 
hi
Application.DisplayAlerts = False
Sheets("Sheet1").Select
ActiveWindow.SelectedSheets.Delete
application.DisplayAlerts = True


Regards
FSt1
 
Insert the following command before the delete

Application.DisplayAlerts = False

Then at the end

Application.DisplayAlerts = True


Although display alerts comes back on automatically I always include the
line to turn it back on. Who know, MS might decide some day that you need to
do it, and if that happens my code will already be up to date.
 
Back
Top