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

  • by
(solved)-–-add-a-pareto-chart-using-vba-in-excel

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()
     Range("R1:R75").Select
     Range("R75").Activate

     Range("R1:R75,E1:E75").Select
     Range("E75").Activate
     ActiveSheet.Shapes.AddChart2(366, xlRegionMap).Select
End Sub

Leave a Reply

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