ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to write a marco in Excel to delete worksheet? (https://www.excelbanter.com/excel-programming/360652-how-write-marco-excel-delete-worksheet.html)

ko06879

How to write a marco in Excel to delete worksheet?
 

Dear Friends,

Do you know how to write a marco in Excel to delete worksheet
automatically, without prompting me to click OK?

I have tried one by using the command:
Sheets("Sheet2").Delete

but it will ask me to click OK before delete it. It looks not
professional.

Thanks a lot.


--
ko06879
------------------------------------------------------------------------
ko06879's Profile: http://www.excelforum.com/member.php...o&userid=34149
View this thread: http://www.excelforum.com/showthread...hreadid=539188


Papou

How to write a marco in Excel to delete worksheet?
 
Hello
Application.DisplayAlerts = False
Sheets("Sheet2").Delete
Application.DisplayAlerts = True

HTH
Cordially
Pascal

"ko06879" a écrit
dans le message de news:
...

Dear Friends,

Do you know how to write a marco in Excel to delete worksheet
automatically, without prompting me to click OK?

I have tried one by using the command:
Sheets("Sheet2").Delete

but it will ask me to click OK before delete it. It looks not
professional.

Thanks a lot.


--
ko06879
------------------------------------------------------------------------
ko06879's Profile:
http://www.excelforum.com/member.php...o&userid=34149
View this thread: http://www.excelforum.com/showthread...hreadid=539188





All times are GMT +1. The time now is 09:39 AM.

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