Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop though all data in PivotItems in a Pivot Table
Hi, all, I have a pivot table which has a column field list all country
names. Every time, I need manuly select one country name in column field and copy the whole table after change to one seperate worksheet. I need repeat doing this for all available country name. I tried to make a VBA program and automatically get all individual country's data. The problem is I don't know how to loop though all data in PivotItems and select only one each time. I tried using Macro Recorder to get a hint. I found instead of deselect all items first and make one desired one visible, the Recorder just make all but one's Visible property False. With ActiveSheet.PivotTables("Test").PivotFields("Out Reciever") .PivotItems("NZ").Visible = False .PivotItems("GB").Visible = False .PivotItems("HK").Visible = False .PivotItems("UK").Visible = False .PivotItems("US").Visible = False End With Can anybody give me a hint how to copy changed pivot table for each data in the column field to a seperate sheet? Thanks Regards, Huyeote |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
need error loop in pivot table routine | Excel Discussion (Misc queries) | |||
Filter lines containing pivot table and non pivot table data | Excel Worksheet Functions | |||
Pivot Change PivotItems - Visible/Hide with VBA | Excel Worksheet Functions | |||
For Each Loop with Pivot Table | Excel Discussion (Misc queries) | |||
Add PivotItems to PivotTable / Enabling - Disabling PivotItems | Excel Programming |