Cells Property

Applies To

DataSheet object, Range object.

Description

Range object: Returns a Range object that represents the cells in the specified range. Read-only.

DataSheet object: Returns a Range object that represents all the cells on the datasheet (not just the cells that are currently in use). Read-only.

See Also

Range property.

Example

This example clears the formula in cell A1 on the datasheet. Note that on the datasheet, column A is the second column and row 1 is the second row.

myChart.Application.DataSheet.Cells(2,2).ClearContents
This example loops through cells A1:I3 on the datasheet. If any of these cells contains a value less than 0.001, the example replaces that value with 0 (zero).

Set mySheet = myChart.Application.DataSheet
For rwIndex = 2 to 4
    For colIndex = 2 to 10
        If mySheet.Cells(rwIndex, colIndex) < .001 Then
            mySheet.Cells(rwIndex, colIndex).Value = 0
        End If
    Next colIndex
Next rwIndex