Skip to content

Latest commit

 

History

History
44 lines (28 loc) · 1.04 KB

Excel.Chart.SetSourceData.md

File metadata and controls

44 lines (28 loc) · 1.04 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Chart.SetSourceData method (Excel)
vbaxl10.chm149162
vbaxl10.chm149162
Excel.Chart.SetSourceData
fc41cc05-087a-f53c-2f54-fd6307de51d6
04/16/2019
medium

Chart.SetSourceData method (Excel)

Sets the source data range for the chart.

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 XlRowCol constants: xlColumns or xlRows.

Example

This example sets the source data range for chart one.

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

[!includeSupport and feedback]