Name

chart.SetSourceData(Source, [PlotBy])

Synopsis

Sets the range to plot in the chart.

Argument

Settings

Source

The Range object to plot.

PlotBy

xlRows plots each row as a series; xlColumns plots each column as a series.

Use SetSourceData to plot new data. This is easier than adding items to the SeriesCollection.

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.