ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Supress Warning Message (https://www.excelbanter.com/excel-programming/374158-supress-warning-message.html)

David Billigmeier

Supress Warning Message
 
I have the following code in a macro:

For i = numVars + 1 To 15
Sheets("numVar" & i).Select
ActiveSheet.Delete
Next

It automatically deletes some tabs in my workbook. Every time I run it I
get a warning message asking if I really want to delete each tab. Is there
any code I can place before I run this loop to supress these warning messages?

Thanks.
--
Regards,
Dave

sonu[_2_]

Supress Warning Message
 
use this at the begning of your code

Application.DisplayAlerts = False



David Billigmeier wrote:
I have the following code in a macro:

For i = numVars + 1 To 15
Sheets("numVar" & i).Select
ActiveSheet.Delete
Next

It automatically deletes some tabs in my workbook. Every time I run it I
get a warning message asking if I really want to delete each tab. Is there
any code I can place before I run this loop to supress these warning messages?

Thanks.
--
Regards,
Dave



Alok

Supress Warning Message
 
Try this

Application.DisplayAlerts = False


"David Billigmeier" wrote:

I have the following code in a macro:

For i = numVars + 1 To 15
Sheets("numVar" & i).Select
ActiveSheet.Delete
Next

It automatically deletes some tabs in my workbook. Every time I run it I
get a warning message asking if I really want to delete each tab. Is there
any code I can place before I run this loop to supress these warning messages?

Thanks.
--
Regards,
Dave



All times are GMT +1. The time now is 11:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com