automatically deleting a worksheet (without warning prompt)

  • Thread starter Thread starter Guerilla
  • Start date Start date
G

Guerilla

Hi,

A macro I use deletes a sheet tab, however, it prompts me to confirm
the deletion of the sheet. How can I remove this prompt so the macro
runs without any user interaction?

Matt
 
I think you can use this:

Sub delSheet()

Application.DisplayAlerts = False
Application.Sheets(1).Delete

End Sub
 
Add these 2 lines to your macro:

Application.Displayalerts = False '<<<< here
worksheets("TempData").Delete
Application.Displayalerts = True ' <<< and here

HTH
 

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