(Solved) – Add a Pareto Chart Using VBA in Excel

  • by

I’m trying to insert a Pareto using VBA. I tried to use the recorder, but the resulting code does not give the same chart (for whatever reason it records the recommended Pareto as (366, xlRegionMap)).

I’d rather not have to hack together a Pareto manually (creating a cumulative percent column etc.) and just go from selecting two columns like I can when inserting manually.

Sub pareto()

     ActiveSheet.Shapes.AddChart2(366, xlRegionMap).Select
End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *