Hi all
Been searching through high and low but haven't found what I was looking for. Perhaps someone here can help.
Quite often I find my self in need of a macro that can hide/show details to a certain level for my Pivot Table in compact mode. It needs to be robust as it should work in various sheets and PivotTables - so hard coding won't work. And although I have tried I have so far failed at making it myself.
Say I have a pivot table in compact mode that has 7 RowFields - it could be and it could less and the values will also vary.
As RowFields(1) it has "names", RowFields(2) it has "stored items", RowFields(3) it has colour - and so on. For each RowField there are alot of pivotItems.
I would like to push a button and use the application inputbox to specify up to which levels detail should be shown. If I say level 2, then all PivotItems detail from RowFields 1 and 2 should be be shown. Rowfields 3 to 7 should be collapsed.
Instead of the input box it could also work with a fixed macro that shows deatails from 1 to 3. I could then just adjust according to needs.
I think I can make the input box work, but the loop through rowfields and PivotItems I can't seem to figure out.
Can some one help?
Best regards
Kasper
Been searching through high and low but haven't found what I was looking for. Perhaps someone here can help.
Quite often I find my self in need of a macro that can hide/show details to a certain level for my Pivot Table in compact mode. It needs to be robust as it should work in various sheets and PivotTables - so hard coding won't work. And although I have tried I have so far failed at making it myself.
Say I have a pivot table in compact mode that has 7 RowFields - it could be and it could less and the values will also vary.
As RowFields(1) it has "names", RowFields(2) it has "stored items", RowFields(3) it has colour - and so on. For each RowField there are alot of pivotItems.
I would like to push a button and use the application inputbox to specify up to which levels detail should be shown. If I say level 2, then all PivotItems detail from RowFields 1 and 2 should be be shown. Rowfields 3 to 7 should be collapsed.
Instead of the input box it could also work with a fixed macro that shows deatails from 1 to 3. I could then just adjust according to needs.
I think I can make the input box work, but the loop through rowfields and PivotItems I can't seem to figure out.
Can some one help?
Best regards
Kasper