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 - Specifies the way the data is to be plotted. Can be either of the following XlRowCol constants: xlColumns or xlRows

Chart.SetSourceData procedure builder