Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
I have a Pivot Table report (Excel 2003 sp1) connecting to a cube on SQL Server 2000 (sp 3a) and am trying to enumerate through a pivot field so that I can print a report for each item in it. On the worksheet there are 20 or so items selectable, but when I try to select one through code, the items count is 0. Below is a fragment of code that I am using (taken from other postings!): ' Dim pt As PivotTable Dim pf As PivotField Dim pi As PivotItem Set pt = ActiveSheet.PivotTables.Item("PivotTable1") ' this is ok as I can do pf.Name Set pf = pt.PivotFields("[Department]") ' this always displays 0 MsgBox pf.PivotItems.Count ' Does anyone have any sugestions please?!?! I have tried ChildItems and also working through CubeFields but by the time I get to PivotItems it all ends!!! Incidently ColumnFields seems ok, but I can't use this because of the way I have to format the report. Many thanks for any help/suggestions iD |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Controlling Pivotitems.visible | Excel Discussion (Misc queries) | |||
Pivot Change PivotItems - Visible/Hide with VBA | Excel Worksheet Functions | |||
Count Filtered Visible Items that Match Numeric Criteria between two ranges | Excel Worksheet Functions | |||
Excel Pivot Tables, Page Fields, Visible PivotItems, Activation | Excel Programming | |||
Add PivotItems to PivotTable / Enabling - Disabling PivotItems | Excel Programming |