98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Graphics in VBA
vba courses london - Graphics in VBA
Resolved · Low Priority · Version Standard
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
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
VBA tip:Stop Display Alerts In ExcelWhen creating or deleting a Worksheet in Excel you don't want Excel to inform you "A file already exists....." Or "Do you want to save this file...". |