ExcelBanter

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

Andy

Pivot Table Page Fields
 
Anyone know if it possible to suppress the "All" option in a pivot table Page
field?

Thanks

Andy

Debra Dalgleish

No, you can't suppress the "All" option in the page field. With
programming, you could select another item if the user selects "All".

For example:
'========================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim pt As PivotTable
Dim pf As PivotField
Set pt = Me.PivotTables(1)
Set pf = pt.PivotFields("Rep")

With pf
If .CurrentPage = "(All)" Then
.CurrentPage = .PivotItems(1).Name
End If
End With
End Sub
'============================

This 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.

Andy wrote:
Anyone know if it possible to suppress the "All" option in a pivot table Page
field?

Thanks

Andy



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 01:56 PM.

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