Deleting worksheets using VBA
Deleting worksheets using VBA
(OP)
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
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





RE: Deleting worksheets using VBA
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!