PC Review


Reply
Thread Tools Rate Thread

Extracting data from Pivot table with VBA

 
 
gorans@gmail.com
Guest
Posts: n/a
 
      23rd Jan 2007
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..|
___________________________________________________

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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting data from external pivot table - Office 2007 omsoft Microsoft Excel Programming 0 2nd Sep 2009 05:06 PM
Create pivot table from pivot table with VBA =?Utf-8?B?QmlrYXNo?= Microsoft Excel Programming 0 21st Nov 2006 09:17 AM
Extracting saved data from pivot table =?Utf-8?B?TWFyY3VzIExhbmdlbGw=?= Microsoft Excel Misc 2 8th Mar 2006 03:51 PM
Pivot Table - Extracting specific data =?Utf-8?B?SlQ=?= Microsoft Excel Worksheet Functions 2 4th Jun 2005 04:16 PM
Pivot Table - Extracting specific data =?Utf-8?B?SlQ=?= Microsoft Excel Worksheet Functions 1 3rd Jun 2005 06:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:23 AM.