@@ -11,7 +11,7 @@ ms.suite: office
1111ms.author : o365devx
1212author : o365devx
1313ms.topic : conceptual
14- ms.date : 11/ 01/2017
14+ ms.date : 01/14/2025
1515ms.localizationpriority : high
1616---
1717# Working with sheets
@@ -25,7 +25,7 @@ SpreadsheetML document, see [Structure of a SpreadsheetML document](structure-of
2525## Sheets in SpreadsheetML
2626
2727The following information from the [ !include[ ISO/IEC 29500 URL] ( ../includes/iso-iec-29500-link.md )]
28- specification introduces the ** sheet** (\< ** sheet** \> ) element.
28+ specification introduces the ** sheet** (` < sheet/> ` ) element.
2929
3030Sheets are the central structures within a workbook, and are where the
3131user does most of their spreadsheet work. The most common type of sheet
@@ -45,12 +45,12 @@ Other types of sheets include chart sheets and dialog sheets.
4545
4646## Open XML SDK Worksheet Class
4747
48- The Open XML SDK** Worksheet** class
49- represents the ** worksheet** ( \< ** worksheet** \> ) element defined in the Open XML File
50- Format schema for SpreadsheetML documents. Use the ** Worksheet** class to manipulate individual \< ** worksheet** \> elements in a SpreadsheetML document.
48+ The Open XML SDK ` Worksheet ` class
49+ represents the ` worksheet ` ( ` < worksheet/> ` ) element defined in the Open XML File
50+ Format schema for SpreadsheetML documents. Use the ` Worksheet ` class to manipulate individual ` < worksheet/> ` elements in a SpreadsheetML document.
5151
5252The following information from the ISO/IEC 29500 specification
53- introduces the ** worksheet** ( \< ** worksheet** \> ) element.
53+ introduces the ` worksheet ` ( ` < worksheet/> ` ) element.
5454
5555An instance of this part type contains all the data, formulas, and
5656characteristics associated with a given worksheet.
@@ -83,23 +83,23 @@ when empty.
8383© ; [ !include[ ISO/IEC 29500 version] ( ../includes/iso-iec-29500-version.md )]
8484
8585A typical spreadsheet has at least one worksheet. The worksheet contains
86- a table like structure for defining data, represented by the ** sheetData** element. A sheet that contains data
87- uses the ** worksheet** element as the root
86+ a table like structure for defining data, represented by the ` sheetData ` element. A sheet that contains data
87+ uses the ` worksheet ` element as the root
8888element for defining worksheets. Inside a worksheet the data is split up
8989into three distinct sections. The first section contains optional sheet
9090properties. The second section contains the data, using the required
91- ** sheetData** element. The third section contains optional supporting
91+ ` sheetData ` element. The third section contains optional supporting
9292features such as sheet protection and filter information. To define an
93- empty worksheet you only have to use the ** worksheet** and ** sheetData** elements. The ** sheetData** element can be empty.
94-
95- To create new values for the worksheet you define rows inside the ** sheetData** element. These rows contain cells,
96- which contain values. The ** row** element
97- defines a new row. Normally the first row in the ** sheetData** is the first row in the visible sheet.
98- Inside the row you create new ** cells** using the \< ** c ** \> element. Values for cells can be provided by
99- storing a \< ** v ** \> element inside the cell.
100- Usually the \< ** v ** \> element contains the
93+ empty worksheet you only have to use the ` worksheet ` and ` sheetData ` elements. The ` sheetData ` element can be empty.
94+
95+ To create new values for the worksheet you define rows inside the ` sheetData ` element. These rows contain cells,
96+ which contain values. The ` row ` element
97+ defines a new row. Normally the first row in the ` sheetData ` is the first row in the visible sheet.
98+ Inside the row you create new ` cells ` using the ` <c/> ` element. Values for cells can be provided by
99+ storing a ` <v/> ` element inside the cell.
100+ Usually the ` <v/> ` element contains the
101101current value of the worksheet cell. If the value is a numeric value, it
102- is stored directly in the \< ** v ** \> element in
102+ is stored directly in the ` <v/> ` element in
103103the XML file. If the value is a string value, it is stored in a shared
104104string table. For more information about using the shared string table
105105to store string values, see [ Working with the shared string table] ( working-with-the-shared-string-table.md ) .
@@ -109,10 +109,10 @@ working with the <xref:DocumentFormat.OpenXml.Spreadsheet.Worksheet> class.
109109
110110| ** SpreadsheetML Element** | ** Open XML SDK Class** |
111111| ---| ---|
112- | sheetData | < xref:DocumentFormat.OpenXml.Spreadsheet.SheetData > |
113- | row | < xref:DocumentFormat.OpenXml.Spreadsheet.Row > |
114- | c | < xref:DocumentFormat.OpenXml.Spreadsheet.Cell > |
115- | v | < xref:DocumentFormat.OpenXml.Spreadsheet.CellValue > |
112+ | ` < sheetData/> ` | < xref:DocumentFormat.OpenXml.Spreadsheet.SheetData > |
113+ | ` < row/> ` | < xref:DocumentFormat.OpenXml.Spreadsheet.Row > |
114+ | ` <c/> ` | < xref:DocumentFormat.OpenXml.Spreadsheet.Cell > |
115+ | ` <v/> ` | < xref:DocumentFormat.OpenXml.Spreadsheet.CellValue > |
116116
117117For more information about optional spreadsheet elements, such as sheet
118118properties and supporting sheet features, see the ISO/IEC 29500
@@ -121,7 +121,7 @@ specification.
121121### SheetData Class
122122
123123The following information from the ISO/IEC 29500 specification
124- introduces the ** sheet data** (\< ** sheetData** \> ) element.
124+ introduces the ** sheet data** (` < sheetData/> ` ) element.
125125
126126The cell table is the core structure of a worksheet. It consists of all
127127the text, numbers, and formulas in the grid.
@@ -131,7 +131,7 @@ the text, numbers, and formulas in the grid.
131131### Row Class
132132
133133The following information from the ISO/IEC 29500 specification
134- introduces the ** row** (\< ** row** \> ) element.
134+ introduces the ** row** (` < row/> ` ) element.
135135
136136The cells in the cell table are organized by row. Each row has an index
137137(attribute r) so that empty rows need not be written out. Each row
@@ -143,7 +143,7 @@ position in the sheet. In this example, the first row of data is row 2.
143143### Cell Class
144144
145145The following information from the ISO/IEC 29500 specification
146- introduces the ** cell** (\< ** c ** \> ) element.
146+ introduces the ** cell** (` <c/> ` ) element.
147147
148148The cell itself is expressed by the c collection. Each cell indicates
149149its location in the grid using A1-style reference notation. A cell can
@@ -157,14 +157,14 @@ written out.
157157### CellValue Class
158158
159159The following information from the ISO/IEC 29500 specification
160- introduces the ** cell value** (\< ** v ** \> ) element.
160+ introduces the ** cell value** (` <v/> ` ) element.
161161
162162Cells contain values, whether the values were directly entered (e.g.,
163163cell A2 in our example has the value External Link:) or are the result
164164of a calculation (e.g., cell B3 in our example has the formula B2+1).
165165
166166String values in a cell are not stored in the cell table unless they are
167- the result of a calculation. Therefore, instead of seeing External Link:
167+ the result of a calculation. Therefore, instead of seeing External Link
168168as the content of the cell's v node, instead you see a zero-based index
169169into the shared string table where that string is stored uniquely. This
170170is done to optimize load/save performance and to reduce duplication of
@@ -177,15 +177,15 @@ indicates string, then it is an index and not a numeric value.
177177### Open XML SDK Code Example
178178
179179The following code example creates a spreadsheet document with the
180- specified file name and instantiates a ** Worksheet** class, and then adds a row and adds a
180+ specified file name and instantiates a ` Worksheet ` class, and then adds a row and adds a
181181cell to the cell table at position A1. Then the value of the cell in A1
182182is set equal to the numeric value 100.
183183
184184### [ C#] ( #tab/cs )
185- [ !code-csharp[ ] ( ../../samples/spreadsheet/working_with_sheets/cs/Program.cs )]
185+ [ !code-csharp[ ] ( ../../samples/spreadsheet/working_with_sheets/cs/Program.cs#snippet0 )]
186186
187187### [ Visual Basic] ( #tab/vb )
188- [ !code-vb[ ] ( ../../samples/spreadsheet/working_with_sheets/vb/Program.vb )]
188+ [ !code-vb[ ] ( ../../samples/spreadsheet/working_with_sheets/vb/Program.vb#snippet0 )]
189189
190190### Generated SpreadsheetML
191191
@@ -208,7 +208,7 @@ the "sheet.xml" file in the "worksheets" folder of the .zip file.
208208## The Open XML SDK Chartsheet Class
209209
210210The following information from the ISO/IEC 29500 specification
211- introduces the ** chartsheet** (\< ** chartsheet** \> ) element.
211+ introduces the ** chartsheet** (` < chartsheet/> ` ) element.
212212
213213An instance of this part type represents a chart that is stored in its
214214own sheet.
@@ -234,12 +234,12 @@ working with the <xref:DocumentFormat.OpenXml.Spreadsheet.Chartsheet> class.
234234
235235| ** SpreadsheetML Element** | ** Open XML SDK Class** |
236236| ---| ---|
237- | drawing | < xref:DocumentFormat.OpenXml.Spreadsheet.Drawing > |
237+ | ` < drawing/> ` | < xref:DocumentFormat.OpenXml.Spreadsheet.Drawing > |
238238
239239### Drawing Class
240240
241241The following information from the ISO/IEC 29500 specification
242- introduces the ** drawings** (\< ** wsDr** \> ) element.
242+ introduces the ** drawings** (` < wsDr/> ` ) element.
243243
244244An instance of this part type contains the presentation and layout
245245information for one or more drawing elements that are present on this
@@ -256,7 +256,7 @@ be only one Drawings part per worksheet or chartsheet.
256256## Open XML SDK Dialogsheet Class
257257
258258The following information from the ISO/IEC 29500 specification
259- introduces the ** dialogsheet** (\< ** dialogsheet** \> ) element.
259+ introduces the ** dialogsheet** (` < dialogsheet/> ` ) element.
260260
261261An instance of this part type contains information about a legacy custom
262262dialog box for a user form.
0 commit comments