Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old January 24th 07, 12:07 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jan 2007
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract pivot table raw data Han Qiao Excel Discussion (Misc queries) 2 October 17th 07 05:41 PM
HOW TO EXTRACT (or lookup) DATA FROM A PIVOT TABLE SSJ New Users to Excel 3 November 9th 06 09:46 PM
how do i extract data from pivot table to txt file stef Excel Discussion (Misc queries) 1 May 24th 06 06:29 PM
need to extract data from a pivot table using variables instead o. KyWilde Excel Programming 0 March 31st 05 09:45 PM
Extract Source Data From Pivot Table Luis Carrion Excel Programming 0 December 24th 04 12:29 AM


All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright 2004-2021 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017