Partager via


SeriesCollection.Extend Method (Excel)

Adds new data points to an existing series collection.

Syntax

expression .Extend(Source, Rowcol, CategoryLabels)

expression A variable that represents a SeriesCollection object.

Parameters

Name

Required/Optional

Data Type

Description

Source

Required

Variant

The new data to be added to the SeriesCollection object as a Range object.

Rowcol

Optional

Variant

Specifies whether the new values are in the rows or columns of the given range source. Can be one of the following XlRowCol constants: xlRows or xlColumns. If this argument is omitted, Microsoft Excel attempts to determine where the values are by the size and orientation of the selected range or by the dimensions of the array.

CategoryLabels

Optional

Variant

True to have the first row or column contain the name of the category labels. False to have the first row or column contain the first data point of the series. If this argument is omitted, Microsoft Excel attempts to determine the location of the category label from the contents of the first row or column.

Return Value

Variant

Remarks

This method is not available for PivotChart reports.

Example

This example extends the series on Chart1 by adding the data in cells B1:B6 on Sheet1.

Charts("Chart1").SeriesCollection.Extend _ 
        Source:=Worksheets("Sheet1").Range("B1:B6") 

See Also

Concepts

SeriesCollection Object

SeriesCollection Object Members