Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Extract data from Pivot table with VBA
Hi,
I am attempting to extract a 'copy' of a pivot table I have automatically generated into another worksheet. However, I would like to modify the formatting of it slightly. I have come accross some fairly novel ways to do this but they will not work for me because the pivot table is genereated from dynamic data. Hence the size and values will constantly be changing. Although, the actual field names will remain constant. The pivot table produces something like this: __________________________________________________ _ .......................................*Company *Class.......|....*attrib......|.C1...|.C2..|.C3.. | ..............|.................|......|.....|.... .| Employee.....|..name...........|...1..|..1..|..0.. | ..............|..surname........|...1..|..1..|..0. .| Document.....|..title..........|...1..|..0..|..1.. | ..............|..id.............|...0..|..1..|..1. .| __________________________________________________ _ and I want to get: __________________________________________________ _ .......................................*Company *Class.......|...*attrib.......|.C1..|.C2..|.C3..| ..............|.................|.....|.....|..... | Employee.......................|..2..|..2..|..1..| ..............|..name...........|..1..|..1..|..0.. | ..............|..surname........|..1..|..1..|..0.. | Document.......................|..1..|..1..|..2..| ..............|..title..........|...1.|..0..|..1.. | ..............|..id.............|..0..|..1..|..1.. | __________________________________________________ _ Note: Copy and past the table into a text editor such as notepad to view properly Does anyone have any hints or tips as to how i can approach this task. I was thinking to nest some for loops for pivot_item in ptable.pivotfields('class').pivotitems for ... but having inspected all the properties of pivot items, pivot fields and pivot cells i cannot find some sort of correlation between class and attribute (the correlation i want is that class should group attributes) If i then have each class-attribute pair, i will be able to get the data i need using getpivotdata or similar. Any help is greately appreciated. Kind Regards Goran |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extract pivot table raw data | Excel Discussion (Misc queries) | |||
HOW TO EXTRACT (or lookup) DATA FROM A PIVOT TABLE | New Users to Excel | |||
how do i extract data from pivot table to txt file | Excel Discussion (Misc queries) | |||
need to extract data from a pivot table using variables instead o. | Excel Programming | |||
Extract Source Data From Pivot Table | Excel Programming |