Cells Property

Microsoft Office Web Components Object Model

Show All

Cells Property

       

Cells property as it applies to the Range, Spreadsheet, and Worksheet objects.

Returns a Range object that represents the cells in the object.

expression.Cells

expression   Required. An expression that returns one of the above objects.

Cells property as it applies to the PivotData and PivotRange objects.

Returns a PivotCell object based on a row and column member.

expression.Cells(Row, Column)

expression   Required. An expression that returns one of the above objects.

Row  Required PivotRowMember object. The specified row.

Column  Required PivotColumnMember object. The specified column.

Example

As it applies to the Range, Spreadsheet, and Worksheet objects.

This example sets the value of cell B3 to 5.

Spreadsheet1.Range("A2:C4").Cells(4).Value = 5

This example clears all cells on Sheet1.

Spreadsheet1.Worksheets("Sheet1").Cells.Clear