Macro for filter in a pivot table

%3CLINGO-SUB%20id%3D%22lingo-sub-1265602%22%20slang%3D%22en-US%22%3EMacro%20for%20filter%20in%20a%20pivot%20table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1265602%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20create%20a%20macro%20that%20allows%20me%20to%20create%20a%20pivot%20table%20and%20the%20corresponding%20pivot%20chart.%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20within%20an%20organization%2C%20I%20have%20business%20units%20and%20for%20each%20business%20unit%2C%20there%20are%20regions.%3C%2FP%3E%3CP%3EFor%20each%20region%2C%20there%20is%20a%20%25%20revenue%20of%20total%20in%20the%20pivot%20table.%3C%2FP%3E%3CP%3EI%20need%20to%20create%20donut%20charts%20for%20the%20regional%20breakup%20of%20revenue%20for%20each%20of%20the%2011%20business%20units.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20still%20a%20beginner%20with%20respect%20to%20Macros%2C%20therefore%2C%20I%20recorded%20the%20macro.%3C%2FP%3E%3CP%3EI%20have%202%20questions%3A%3C%2FP%3E%3CP%3Ea.%20How%20do%20I%20create%20a%20repetitive%20macro%20that%20creates%20these%2011%20donut%20charts%20for%20me%3F%3C%2FP%3E%3CP%3Eb.%20When%20I%20run%20the%20macro%2C%20it%20gives%20me%20a%20Runtime%20Error%20'5'%20and%20it%20is%20not%20because%20of%20the%20folder%20name.%20How%20do%20I%20get%20rid%20of%20this%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%3C%2FP%3E%3CP%3EAnkit%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1265602%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Regular Visitor

Hi Community,

 

I am trying to create a macro that allows me to create a pivot table and the corresponding pivot chart. 

For example, within an organization, I have business units and for each business unit, there are regions.

For each region, there is a % revenue of total in the pivot table.

I need to create donut charts for the regional breakup of revenue for each of the 11 business units. 

I am still a beginner with respect to Macros, therefore, I recorded the macro.

I have 2 questions:

a. How do I create a repetitive macro that creates these 11 donut charts for me?

b. When I run the macro, it gives me a Runtime Error '5' and it is not because of the folder name. How do I get rid of this?

 

Thanks in advance

Ankit

 

0 Replies