You need to save this macro in a notepad and save as filename.vb
Static macro
Option Explicit
Sub Macro1()
'
' Macro1 Macro
'
'
ActiveSheet.PivotTables("Your Pivot table name").PivotFields("your column name"). _
Orientation = xlHidden
End Sub
Dynamic Macro
you need to give the column name in the invoke vba actvity parameter
Option Explicit
Sub Macro1(ColumnName As String)
'
' Macro1 Macro
'
'
ActiveSheet.PivotTables("PivotTable1").PivotFields(ColumnName). _
Orientation = xlHidden
End Sub
Unfortunately I don’t believe I can use macros, since in order to use them I have to ‘enable macros’ in excel, and it seams like it can cause security issues.