Hello,
I'm trying to sort the pivot tables on my sheet and hide the blank entries in the row field
My code so far seems to sort but fail on the
What am I doing wrong?
I'm trying to sort the pivot tables on my sheet and hide the blank entries in the row field
My code so far seems to sort but fail on the
pf.PivotItems("").Visible = False
part.
VBA Code:
Sub SortPivots_HideBlanks()
Dim pt As PivotTable
Dim pf As PivotField
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.RowFields
pf.PivotItems.AutoSort xlDescending
pf.PivotItems("").Visible = False
Next pf
Next pt
End Sub
What am I doing wrong?