ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Pivot Table Page (https://www.excelbanter.com/excel-discussion-misc-queries/191417-pivot-table-page.html)

PFLY

Pivot Table Page
 
Is there a way to remove "all" as an option from a page on a pivot table?

PMU

Pivot Table Page
 
You can remove all of a specific category by going to the pivot category
itself and selecting the down arrow on the main page. That will produce a
drop down list and you can deselect the check boxes for whatever you don't
want to view in the table.

"PFLY" wrote:

Is there a way to remove "all" as an option from a page on a pivot table?


Debra Dalgleish

Pivot Table Page
 
You can't remove the "All" option in the page field. With programming,
you could select another item if the user selects "All".

For example, the following code is stored on the worksheet's code module:
Right-click the sheet tab, and choose View Code
Paste the code where the cursor is flashing.
Change the field name to match your pivot table

'========================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim pt As PivotTable
Dim pf As PivotField
Dim i As Long
Set pt = Me.PivotTables(1)
Set pf = pt.PivotFields("Employee")


With pf
If .CurrentPage = "(All)" Then
i = 1
For i = 1 To pf.PivotItems.Count + 1
On Error Resume Next
.CurrentPage = .PivotItems(i).Name
If Err.Number = 0 Then
Exit For
End If
Next i
MsgBox "The (All) option is not available"
End If
End With


End Sub
'============================



PFLY wrote:
Is there a way to remove "all" as an option from a page on a pivot table?



--
Debra Dalgleish
Contextures
www.contextures.com/tiptech.html
Blog: http://blog.contextures.com



All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com