What is the syntax to delete a worksheet?

Worksheets(“<worksheet name>”).Delete

When running this code, the following message box will automatically pop-up:

image040.jpg

To delete a worksheet without this dialog popping up, insert these two lines of code:

Application.DisplayAlerts = False
Worksheets(“<worksheet name>”).Delete
Application.DisplayAlerts=true

 

Advertisements