Hello All,
I'm trying to write a macro to expand all pivot fields (without having to name each one), but can't figure it out. Just need some help from the forum.
Here is my first attempt, but it's not working...
Here is my second try--trying out something new, but with no success...
Any help on this would be greatly appreciated. Thank you for reading my post, --Ben
I'm trying to write a macro to expand all pivot fields (without having to name each one), but can't figure it out. Just need some help from the forum.
Here is my first attempt, but it's not working...
Code:
Dim PT As PivotTable
Dim PF As PivotField
Set PT = ActiveSheet.PivotTables(1)
For Each PF In PT.PivotFields
PF.ShowDetail = True
Next PF
Here is my second try--trying out something new, but with no success...
Code:
Dim PT As PivotTable
Set PT = ActiveSheet.PivotTables(1)
With PT.DataBodyRange
.Cells(.Count).ShowDetail = True
End With
Any help on this would be greatly appreciated. Thank you for reading my post, --Ben