Morning Forum!
I need help with a macro that I think should be quite easy, but I just can’t seem to get it to work. Ultimately what I am trying to do is to get the macro below to clear the All Columnfields so part 2 of the macro can change that field. Part 2 is working fine, but the part where it clears the columnfields is not working. Just to clarify, I am looking to clear everything & anything in the column field (as this field may change), not just a specific item…
Thanks in advance for your assistance!
Sub ClearProcPivot()
'
' ClearProcPivot Macro
'
'
Dim PT As PivotTable
Dim PF As PivotField
Set PT = ActiveSheet.PivotTables("PivotTable2")
For Each PF In PT.ColumnFields
Orientation = xlHidden
Next PF
With ActiveSheet.PivotTables("PivotTable2").PivotFields("MGR2")
.Orientation = xlColumnField
.Position = 1
End With
End Sub
Bookmarks