Skip to main content

How to: Delete a Worksheet

This example demonstrates how to remove a worksheet from a workbook by calling the WorksheetCollection.Remove or WorksheetCollection.RemoveAt method of the WorksheetCollection object that is accessed via the Workbook.Worksheets property.

View Example

// Delete the "Sheet2" worksheet from the workbook.
workbook.Worksheets.Remove(workbook.Worksheets["Sheet2"]);

// Delete the first worksheet from the workbook.
workbook.Worksheets.RemoveAt(0);