Macro to create pivot tables for each Cost Code

curly

New Member
Joined
Jan 25, 2011
Messages
5
Hi & Morning!

I'm not very advanced at all with Macros but I need one to assist me with a large project.

I have found a macro to create a single worksheet for each cost code in a column of data - Part One Complete! :)

xxxx

I have a large set of data which is similar to below

Column
A - Emp No
B - Salary
C - Gender
D - Job Family
E - Job Family 2
F - Business Unit
G - Cost Code

I need a macro to create a single pivot table for each cost code (of which there are 152).

I'd like the Pivot to look like this

Row
F - Business Unit
G - Cost Code
D - Job Family
E - Job Family 2

Column
C - Gender

Data
B - Average Salary

The end result will be 152 pivot tables all based on the criteria above. Is this possible?

Thank You in advance

Em x
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Why don't you pivot the entire set of data, put the cost code in a page field and then do the Show Pages command ( or Show Filter Report Pages in Excel 2007 ), which will generate a pivottable for each cost centre. ( you don't need it in the body of the pivottable as each one will be for a single cost centre )
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,153
Members
452,891
Latest member
JUSTOUTOFMYREACH

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