Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting worksheets using VBA 1

Status
Not open for further replies.

ab123456

Chemical
Joined
Mar 18, 2003
Messages
58
Location
ES
I have a macro that deletes a sheet from the workbook if a certain event occurs. This is done by the code

Sheets("OldSheet").delete

the problem is that Excel prompts the user to confirm delete, is there a way i can stop this message popping up and delete the sheet without prompting

Thanks
 
Hello,

Try this code


Sub Macro1()
Application.DisplayAlerts = False
Sheets("Sheet3").Delete
Application.DisplayAlerts = true
End Sub



Hope this helps.

----------------------------------

maybe only a drafter
but the best user at this company!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top