Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Shapes.AddChart Method

Office 2007
Creates a chart at the specified location on the active sheet.

Version Information
 Version Added:  Excel 2007


expression.AddChart(Type, Left, Top, Width, Height)

expression   A variable that represents a Shapes object.


NameRequired/OptionalData TypeDescription
TypeOptionalXlChartTypeThe chart type.
LeftOptionalVariantThe distance, in points, from the left edge of the object to the left edge of column A (on a worksheet) or the left edge of the chart area (on a chart).
TopOptionalVariantThe distance, in points, from the top edge of the topmost shape in the shape range to the top edge of the worksheet.
WidthOptionalVariantThe width, in points, of the object.
HeightOptionalVariantThe height, in points, of the object.

Return Value


If the chart type is omitted, the default chart type for the application is used. If the position is omitted, the default size for the application is used.


The following example adds a chart to the active worksheet. The data for the stacked cylinder column chart type is taken from cells A10 to B14.

Visual Basic for Applications
    ActiveChart.SetSourceData Source:=Range("Sheet1!$A$10:$B$14"), PlotBy:= _
    ActiveChart.ChartType = xlCylinderColStacked

Community Additions

© 2015 Microsoft