Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pivot Items
Hi
I would like to know what code should I write to hide all the PivotItems a PivotField might have instead of writing a line of code for each PivotItem like this: Worksheets("sheet3").PivotTables(1) _ .PivotFields("year").PivotItems("1998").Visible = False Regards, Pedro |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pivot Items
Dim pvtItm as PivotItem, i as Long
i = 0 for each pvtItm in Worksheets("sheet3").PivotTables(1) _ .PivotFields("year").Items if i < 0 then pvtItm.visible = False else pvtItm.Visible = True end if i = i + 1 Next However, at least one item has to remain visible I believe. (Thus I don't hide the first one in the above). Debra Dalgleish's site has some good information on programming Pivot Tables: http://www.contextures.com/tiptech.html -- Regards, Tom Ogilvy "Pedro" wrote in message ... Hi I would like to know what code should I write to hide all the PivotItems a PivotField might have instead of writing a line of code for each PivotItem like this: Worksheets("sheet3").PivotTables(1) _ .PivotFields("year").PivotItems("1998").Visible = False Regards, Pedro |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot table - old items | Excel Discussion (Misc queries) | |||
top items in a pivot by page | Excel Discussion (Misc queries) | |||
Name items in Pivot Tables? | Excel Discussion (Misc queries) | |||
Pivot table items | Excel Discussion (Misc queries) | |||
How to eliminate any new pivot Items | Excel Programming |