Click here to Skip to main content
15,889,790 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to VB and am trying to learn how to create a pie chart out of certain values on the excel spreadsheet. I know how to do the bar charts but i was wondering whether you guys are aware of online resources or tutorials for this..
Thanks.

What I have tried:

VB
Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.SetSourceData Source:=Sheets("Sheet11").Range("B4:C99"), PlotBy:= _
    xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet11"
ActiveChart.HasTitle = False
Posted
Updated 8-Nov-17 10:48am

The easiest way to learn is to record a macro creating the pie chart manually. You can then go into the Macro Editor and see the code that was created.
 
Share this answer
 
Excel have a feature that record user actions and translate those actions into VBA code.
- Start a new macro recording
- do your actions (a pie chart)
- Stop macro recording
- go to VBE and inspect code, then adapt to integrate to your code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900