Nicola has attended:
Excel VBA Intro Intermediate course
Graphics in VBA
When you have made a pivot table for multiple choices. how do you change the sourced data to a chart rather than a pivot table?
Thanks
RE: Graphics in VBA
A pivot chart is always created together with a Pivot Table.
If you have created a Pivot Table using VBA code you can do the following:
Add the following code to the end of the routine creating the Pivot Table
OR
Create a separate routine wheck can be called when needed.
Sub CreatePivotChart()
Charts.Add After:=Worksheets("Sales Summary")
'Set the source data by pionting to one of the cells in the Pivot Table
ActiveChart.SetSourceData Source:=Sheets("Sales Summary").Range("A12")
ActiveChart.Location Where:=xlLocationAsNewSheet
ActiveChart.Name = "Pivot Chart"
'If you name the chart as above make sure you check if a chart exists and delete it before creating a new one
End Sub