Create Pivot Charts with VBA

Misca

Well-known Member
Joined
Aug 12, 2009
Messages
1,749
Office Version
  1. 365
Platform
  1. Windows
Hi everyone!

I'm in trouble trying to create Pivot Charts with VBA: I've recorded a macro and tried to edit it to make it prettier / more functionable but with no such luck.

Here's what I'm trying to do:

I've got my data area (=25 columns / several thousands rows) on my worksheet and I'm trying to create another workbook with just the pivot tables / -charts and not just one of them but seven of them. The basic setup of all the charts & tables is the same: They all have the same page fields, row fields and column fields and the only difference is the data field.

Is there an easy way to make this happen in VBA?

Also, most of the charts will be having the same kind of formatting on them (get rid of the grey background and make them line charts with company colors and that's it). Is there a way to use the same macro for all charts using the same formatting or do I have to record each separately if the names are different? I'm also going to have to do the same kind of new workbooks over and over again (= once a month for several customers) and I wanted to ask if there's a way to have the macro create the new workbooks with chart formatting macros & events already in the modules or would it be better if I used one premade workbook as a basis and just update the pivot cache (and how would I do that if the data area is in a different workbook?)

I'd prefer to have all the creating macros in just the "main" workbook and as few macros and all in the other ones because of the size: I'm not even half way done yet but the size of the basic workbook is already 20 Mb (and growing).

Thank you already in advance.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,214,857
Messages
6,121,948
Members
449,056
Latest member
FreeCricketId

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top