PDA

View Full Version : VBA to test if particular measure exists in pivot table (PowerPivot Pivot Table)



BobNeil
09-03-2015, 10:36 PM
Hi gurus,

I am creating a simple macro that switches the measure in a pivot table.

E.g. a button that says "Sales" to add the Total Sales measure, and "Cost" to take Total Sales out of the pivot and put in the measure "Total Cost".

If you click cost a second time by mistake, you get an error. So I want to test what measure is in the pivot table, and then take action based on that.

Note that my pivot table is from PowerPivot.

Any help would be greatly appreciated.

Thanks
Bob