Cells Property

Microsoft Graph Visual Basic

expression.Cells

expression    Required. An expression that returns an object in the Applies To List.

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