Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I random sample from a set until every sample is selected? random sampling Excel Discussion (Misc queries) 6 April 26th 10 09:54 PM
DV0017 - Debra's Validation Code MKuria New Users to Excel 1 September 15th 09 06:07 PM
Sample code to be fixed! Hilton Excel Discussion (Misc queries) 0 October 1st 08 03:22 PM
VSTO - dynamic Hide/Unhide PivotItem OLAP. zeric New Users to Excel 0 January 31st 06 02:06 PM
code sample for executing a VB function in Excel using perl newOLE Excel Worksheet Functions 7 August 10th 05 10:26 PM


All times are GMT +1. The time now is 02:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"