Referencing Charts and Chart Objects in VBA Code
Sub SpecifyLocation()
Dim WS As Worksheet
Set WS = Worksheets("Sheet1")
WS.Shapes.AddChart(xlColumnClustered, Left:=100, Top:=150, Width:=400, Height:=300).Select
ActiveChart.SetSourceData Source:=WS.range("A1:E4")
End Sub
Related examples in the same category