Chart.SetSourceData (Excel)

Sets the source data range for the chart.

SetSourceData (Source, PlotBy)


Charts(1).SetSourceData Source:=Sheets(1).Range("a1:a10"), _ 
 PlotBy:=xlColumns

Arguments

The following argument is required

Source (Range) - The range that contains the source data.

Optional arguments

The following argument is optional

PlotBy (XlRowCol) - Specifies the way the data is to be plotted. Can be either of the following XlRowCol constants: xlColumns or xlRows.

Possible return values are xlColumns - Data series is in a row, xlRows - Data series is in a column.