Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ChildItems and ParentItem of PivotItem object dont seem to work
Hi there,
I need to retrive data from a pivot table that is not from an OLAP source. I need to get the data for a item and then also display that data for the parent of that item. Basically they want to see sales for a particular product and then the sales of that product group. There are hundreds of products so I need to be able to lookup its parent from the pivot table. Once I have the parent I can retrieve data using getPivotData. However I just get the message ""Unable to get the ParentItem property of the PivotItem" It says something similar if I try to get the ChildItems collection. Any help is appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ChildItems and ParentItem of PivotItem object dont seem to work
ParentItem and ChildItem are for grouped items. The following code
should work for adjacent column fields. '============================== Sub GetOuterFieldItem() Dim pt As PivotTable Dim pf As PivotField Dim pi As PivotItem Dim rngPG As Range Set pt = ActiveSheet.PivotTables(1) Set pf = pt.PivotFields("Product") Set pi = pf.PivotItems("ProductA") Set rngPG = Range(pi.LabelRange.Address).Offset(0, -1) Debug.Print rngPG.PivotItem.Name End Sub '======================== mxc wrote: Hi there, I need to retrive data from a pivot table that is not from an OLAP source. I need to get the data for a item and then also display that data for the parent of that item. Basically they want to see sales for a particular product and then the sales of that product group. There are hundreds of products so I need to be able to lookup its parent from the pivot table. Once I have the parent I can retrieve data using getPivotData. However I just get the message ""Unable to get the ParentItem property of the PivotItem" It says something similar if I try to get the ChildItems collection. Any help is appreciated. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
flash object dont work in my excel work sheet | Excel Discussion (Misc queries) | |||
New Buttons dont work after I put them in the toolbar | New Users to Excel | |||
Formulas dont work | Excel Discussion (Misc queries) | |||
PivotTable: ChildItems and ParentItem don't work | Excel Programming | |||
macros dont work | Excel Programming |