What is a Worksheet?
A worksheet is a type of Sheet and the primary working surface in a Workbook. It organizes data in a grid of rows and columns, where each intersection forms a cell. A workbook can contain multiple worksheets with related content, and only one worksheet is active at a time.
In SpreadProcessing,
Worksheetis the only type ofSheetcurrently supported.
Worksheet Dimensions
Each worksheet provides a grid of 1,048,576 rows and 16,384 columns, matching the capacity of an Excel worksheet. Rows are identified by zero-based numeric indexes and columns by zero-based column indexes. In the spreadsheet UI, rows are labeled with numbers (1, 2, 3, ...) and columns with letters (A, B, C, ..., XFD).
Key Features
The following list summarizes the main features that a worksheet exposes:
-
Cells: Each worksheet contains a large number of cells that can hold values and formatting options. The
Cellsproperty lets you insert, manipulate, and delete cells. For more information, refer to the article on what a cell is. -
Rows and Columns: Cells are organized in rows and columns. The worksheet API lets you insert, manipulate, and delete rows and columns, and adjust their height and width. For more information, refer to the article on working with rows and columns.
-
Named Ranges: The
Worksheetclass exposes aNamesproperty of typeNameCollectionthat lets you create, update, and manage named ranges. For more information, refer to the Names article. -
Used Cell Range: The
UsedCellRangeproperty returns the smallest cell range that starts from A1 and contains all cells with data or formatting. TheGetUsedCellRange()method accepts anIEnumerable<IPropertyDefinition>parameter and narrows the result to cells with specific property definitions.The following example demonstrates how to get the used cell range of cells with a value.
Example 1: Get the used cell range of cells with a value
C#CellRange result = worksheet.GetUsedCellRange(new IPropertyDefinition[] { CellPropertyDefinitions.ValueProperty });For more information and examples, refer to the article on iterating used cells.
-
Hyperlinks: Each worksheet can contain hyperlinks to web pages, specific cells in the workbook, or email addresses. For more information, refer to the Hyperlinks article.
-
Find and Replace: You can search for and replace text and numbers in the content of a worksheet. For more information, refer to the Find and Replace article.
-
Protection: You can restrict users from modifying the content and structure of a worksheet. When protection is enabled, users can only edit cells explicitly marked as unlocked. You can also control which options remain available when protection is active. For more information, refer to the Worksheet Protection article.
-
View State: Each worksheet provides properties for controlling how it is displayed, including frozen rows and columns, the active cell, the current selection, and the zoom level. For more information, refer to the View State article.
-
Visibility: Worksheets can be hidden from view without being removed from the workbook. For more information, refer to the Sheets Visibility article.
See Also
- What is a Cell?
- Working with Rows and Columns
- Iterating Used Cells
- Named Ranges
- Worksheet Protection
- View State
This documentation is neither affiliated with, nor authorized, sponsored, or approved by, Microsoft Corporation.