Name

seriescollection.Add(Source, [Rowcol], [SeriesLabels], [CategoryLabels], [Replace])

Synopsis

Adds a new series and plots it on a chart.

Argument

Settings

Source

The Range object to plot as the new series.

Rowcol

An xlRowCol constant that determines how the series is plotted. Can be xlColumns or xlRows.

SeriesLabels

True interprets the first row or column of Source as a series label; False treats the first row or column as data. Defaults to a best guess based on the source data.

CategoryLabels

True interprets the first row or column of Source as a category label; False treats the first row or column as data. Defaults to a best guess based on the source data.

Replace

If CategoryLabels is True, setting Replace to True replaces matching categories with the new labels; False does not replace the categories.

Use the Chart object’s SetSourceData method to replace all of the series on a chart with new data.

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.