Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Debra's sample code to hide a Pivotitem
Hi,
I am using Debra's sample code that she has provided in her website (thanks for the knowledge sharing. its awesome) This is the code and it doesnt work with pivot tables that talk to OLAP cubes. On Pivot tables created from a excel list this code works fine. Anyone has any idea? -------------- Sub HidePivotItemsVisible() 'hide all pivot items in all tables on sheet 'except last item Dim pt As PivotTable Dim pf As PivotField Dim pi As PivotItem Application.ScreenUpdating = False Application.DisplayAlerts = False On Error Resume Next For Each pt In ActiveSheet.PivotTables For Each pf In pt.VisibleFields pf.AutoSort xlManual, pf.SourceName For Each pi In pf.PivotItems If pi.Visible = False Then pi.Visible = True Else pi.Visible = False End If Next Next pf.AutoSort xlAscending, pf.SourceName Next Application.DisplayAlerts = True Application.ScreenUpdating = True End Sub --------------- Thanks, Fred |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I random sample from a set until every sample is selected? | Excel Discussion (Misc queries) | |||
DV0017 - Debra's Validation Code | New Users to Excel | |||
Sample code to be fixed! | Excel Discussion (Misc queries) | |||
VSTO - dynamic Hide/Unhide PivotItem OLAP. | New Users to Excel | |||
code sample for executing a VB function in Excel using perl | Excel Worksheet Functions |