Complete the code to insert a treemap chart from data in Excel.
ActiveSheet.Shapes.AddChart2(251, [1], 100, 100, 400, 300).Select
The code uses xlTreemap to create a treemap chart type in Excel VBA.
Complete the code to insert a sunburst chart from data in Excel.
ActiveSheet.Shapes.AddChart2(251, [1], 50, 50, 500, 350).Select
The xlSunburst constant creates a sunburst chart in Excel VBA.
Fix the error in the VBA code to set the chart title for a treemap chart.
With ActiveChart
.ChartTitle.Text = [1]
End WithThe chart title text must be a string enclosed in quotes, like "Sales Data".
Fill both blanks to set the chart type and add data source for a sunburst chart.
With ActiveSheet.Shapes.AddChart2(251, [1], 10, 10, 600, 400).Chart .SetSourceData Source:=Sheets("Data").Range([2]) End With
Use xlSunburst for the chart type and specify the data range as a string like "B2:D15".
Fill all three blanks to create a treemap chart, set its title, and specify data range.
With ActiveSheet.Shapes.AddChart2(251, [1], 20, 20, 450, 350).Chart .SetSourceData Source:=Sheets("Sheet1").Range([2]) .ChartTitle.Text = [3] End With
Use xlTreemap for the chart type, specify the data range as a string, and set the chart title as a quoted string.