To change the type of chart use similar code. This creates, then changes an existing, selected chart.
'this is the range for my chart data
Range("A1:Q11").Select
'this adds the chart
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:Q11"), PlotBy _
:=xlRows
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
'this selects the existing chart
ActiveChart.ChartArea.Select
'this selects the new chart type
ActiveChart.ChartType = xl3DPie
|