Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I am using Excel 2000. I wish to get ride of that "(ALL)" option in Excel PivotTable PageFields by delete/hide it using VBA. The surprising thing is: This "(ALL)" not belong to PivotItem of PageFields or PivotFields. It seems can't be accessed UNLESS it is displayed as PageFields.VisibleItem(1) (by default) When I try PageFields.PivotItem("(ALL)").Visible = False I always get the same error message: "Object doesn't support this property or method" Thanks in advance. Charles |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As answered in microsoft.public.excel --
You could use the Worksheet_Calculate event to switch the selection to the first item in the page field list. Place the following code on the worksheet module: '========================== Private Sub Worksheet_Calculate() 'if (All) is selected from a page field 'the first item is selected instead Dim pt As PivotTable Dim pf As PivotField Set pt = ActiveSheet.PivotTables(1) For Each pf In pt.PageFields If pf.CurrentPage = "(All)" Then pf.CurrentPage = pf.PivotItems(1).Name End If Next pf Application.EnableEvents = True End Sub '=============================== Charles wrote: Hi All, I am using Excel 2000. I wish to get ride of that "(ALL)" option in Excel PivotTable PageFields by delete/hide it using VBA. The surprising thing is: This "(ALL)" not belong to PivotItem of PageFields or PivotFields. It seems can't be accessed UNLESS it is displayed as PageFields.VisibleItem(1) (by default) When I try PageFields.PivotItem("(ALL)").Visible = False I always get the same error message: "Object doesn't support this property or method" Thanks in advance. Charles -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
2007 Need macro to auto set option buttons all to "Yes" or "No" | Excel Worksheet Functions | |||
Why is the "zoom" option grayed out in "print preview?" | Excel Discussion (Misc queries) | |||
pictures to work with "data" "sort" option | Excel Discussion (Misc queries) | |||
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc | Excel Programming | |||
Make "Worksheet Menu Bar" invisible or Delete/hide it's buttons | Excel Programming |