SetCellValue Method (R)
.SetCellValue(object,categories,cell). Sets the value of the specified cell. The argument object is a reference
to the associated BasePivotTable
object. The argument categories is the list of the category values that specifies the cell--one
value for each of the dimensions in the pivot table. The argument cell is the cell value. Category values and
the cell value must be specified as CellText objects (one of CellText.Number
, CellText.String
, CellText.VarName
, or CellText.VarValue
).
- In the list that specifies the category values, the
first element corresponds to the first appended dimension, the second
element to the second appended dimension, and so on. For example,
if the pivot table has two row dimensions and one column dimension
and the row dimensions are appended before the column dimension, then:
list(rowdim1_cat1,rowdim2_cat3,coldim_cat1)
specifies the cell whose category values are
rowdim1_cat1
in the first appended row dimension,rowdim2_cat3
in the second appended row dimension, andcoldim_cat1
in the column dimension.
For an example of using the SetCellValue
method, see the CellText.toNumber method.