Values Property

Microsoft Excel Visual Basic

Returns an array that contains the current values of the changing cells for the scenario. Read-only Variant.

expression.Values(Index)

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

Index   Optional Variant. The position of the value.

ShowValues property as it applies to the Series object.

Returns or sets a collection of all the values in the series. This can be a range on a worksheet or an array of constant values, but not a combination of both. See the examples for details. Read/write Variant.

expression.Values

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

Remark

For PivotChart reports, this property is read-only.

Example

This example sets the series values from a range.

Charts("Chart1").SeriesCollection(1).Values = _
    Worksheets("Sheet1").Range("C5:T5")
		

To assign a constant value to each individual data point, you must use an array.

Charts("Chart1").SeriesCollection(1).Values = _
    Array(1, 3, 5, 7, 11, 13, 17, 19)