Syntax

expression.SetSourceData(Source, PlotBy)

expression A variable that represents a Chart object.

Parameters

Name Required/Optional Data Type Description
Source Required Range The range that contains the source data.
PlotBy Optional Variant Specifies the way the data is to be plotted. Can be either of the following constants: xlColumns or xlRows.

Example

This example sets the source data range for chart one.

Visual Basic for Applications
Charts(1).SetSourceData Source:=Sheets(1).Range("a1:a10"), _ PlotBy:=xlColumns
Change chart's source of information? Define the data area for a bar chart? Establish the area from which a graph gets data? Pick a new row as a radar chart's input? set set source data Set Source Data Method setsource setsourcedata SetSourceData Method Tell a chart where to get data?

See also: