VBA Pivot Table - Using a column as 3 different pivotfields?

Oracus

New Member
Joined
Sep 7, 2014
Messages
1
A bit of a strange one I think, as it's the first problem I've not been able to find, along with it's solution via Google!

From my data set, I'm trying to code a few pivot tables, but some of them will use a column from the orig data as 3 different pivotfields - filter, column and as a count for a datafield.

I've tried recording the macro, and writing it from scratch, but get the same problem either way. When run, the macro seems to only allow a column to be in one pivotfield, with the column only appearing as the count datafield which was the last time it was referred to in the code - stepping through I've found that it is added as a filter, but removed when it is added as a column, with the same happening again when added as the datafield.

Anyone able to point out where I'm going wrong, or a nice work around? Thanks.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,214,971
Messages
6,122,521
Members
449,088
Latest member
RandomExceller01

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