how to hide the "(All)" option on a pivot table

N

nockam

I am trying to hide a "Page" option on a pivot table. I need to hide \
disable the "(all)" option and create another one with an accurate
calculation. I can handle making the other one but I cannot seem to
find a way to hide the "(all)" option. If anyone can provide any help
it would be greatly appreciated. I alredy tried making another "(all)"
section but it just lists 2 all sections on the page view drop down on
the pivot table. Thanks,

Garrett
 
D

Dave Peterson

From a Debra Dalgleish post:

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
'===============================
 
N

nockam

that sounds like it will do the trick. I will give it a shot and pos
back what happens. Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top