Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski 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
Mar 18, 2003
58
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
 
Replies continue below

Recommended for you

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