ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete method (https://www.excelbanter.com/excel-programming/322421-delete-method.html)

chessley

Delete method
 
Does anyone know how to stop the delete method from prompting the user when
you use it to delete a chart sheet. I'm using it to delete multiple sheets
and it get annoying to have to press enter repeatedly

sebastienm

Delete method
 
Hi,
Try
Application.DisplayAlerts =False

Regards,
sebastien

"chessley" wrote:

Does anyone know how to stop the delete method from prompting the user when
you use it to delete a chart sheet. I'm using it to delete multiple sheets
and it get annoying to have to press enter repeatedly


Ben

Delete method
 
Chessley,

Sub byebye()
Application.DisplayAlerts = False
ThisWorkbook.Charts("Chart1").Delete
Application.DisplayAlerts = True
End Sub

where "Chart1" is the chart you are deleting, with this method always make
sure to turn Alerts Back on using Application.DisplayAlerts = True


"chessley" wrote:

Does anyone know how to stop the delete method from prompting the user when
you use it to delete a chart sheet. I'm using it to delete multiple sheets
and it get annoying to have to press enter repeatedly



All times are GMT +1. The time now is 02:08 PM.

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