hi all, I have searched this forum and ended up following a link which gives me:
this only applies to the rows in the first pivot column in my table.
Can anyone tell me how I apply this to all pivot columns?
or a specified one?
Code:
Sub PivotShowItemAllVisible()
'sort is set to Manual to prevent errors, e.g.
'unable to set Visible Property of PivotItem class
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
pi.Visible = True
Next pi
pf.AutoSort xlAscending, pf.SourceName
Next pf
Next pt
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
this only applies to the rows in the first pivot column in my table.
Can anyone tell me how I apply this to all pivot columns?
or a specified one?