Delete method

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

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top