Working with Worksheets

The Worksheet and Worksheet classes contain the methods and properties you use to perform tasks with worksheets.

Task

Procedure

Add a new worksheet to a workbook.

How to: Add New Worksheets to Workbooks

Make a copy of a worksheet in a specified location in the workbook.

How to: Copy Worksheets

Delete a specified worksheet.

How to: Delete Worksheets from Workbooks

Move the user's selection to a specified worksheet.

How to: Select Worksheets

Iterate through the collection of all worksheets.

How to: List All Worksheets in a Workbook

Preview and print a worksheet.

How to: Print Worksheets

Move a worksheet to a new location in a workbook.

How to: Move Worksheets Within Workbooks

Change the visibility of one or more worksheets.

How to: Hide Worksheets

Lock all or part of a worksheet so it cannot be edited.

How to: Protect Worksheets

Remove the lock from a worksheet so it can be edited.

How to: Remove Protection from Worksheets

Add and delete comments.

How to: Add and Delete Worksheet Comments

Show or hide all comments.

How to: Display Worksheet Comments

Create groups in worksheets.

How to: Group Rows in a Worksheet

Make a row bold only when it contains a selected cell.

How to: Change Formatting in Worksheet Rows Containing Selected Cells

Copy data and formatting across worksheets.

How to: Copy Data and Formatting across Worksheets

Check spelling in worksheets.

How to: Check Spelling in Worksheets

Sort data in named ranges and list objects.

How to: Sort Data in Worksheets Programmatically

Hide a worksheet.

Hidden Worksheets

For more information about Excel tasks and the Excel object model, see Excel Object Model Overview.

In some cases, the ways that you perform these tasks in application-level add-ins is different from the ways that you perform them in document-level customizations.

See Also

Concepts

Automating Excel by Using Extended Objects

Working with Workbooks

Working with Ranges

Working with Cells

Using Windows Forms Controls on Excel Worksheets