Hi All,
I am trying to replace a column in a pivot table using a drop down or Combo box.
When recording a macro and doing it manually I get this
Sub Macro2()
ActiveSheet.PivotTables("MainPivotTable").CubeFields("[ETO].[Site Manager]"). _
Orientation = xlHidden
With ActiveSheet.PivotTables("MainPivotTable").CubeFields("[ETO].[Suburb]")
.Orientation = xlRowField
.Position = 1
End With
End Sub
I have also found online someone who can change the data source using a combo box
Sub ChangeDataSource()
With ActiveSheet.Shapes(Application.Caller).ControlFormat
ActiveSheet.PivotTables("PivotTable1").PivotTableWizard SourceType:=xlDatabase, SourceData:= _
.List(.Value)
End With
End Sub
Is there a way to modify the second query to change the pivot columns instead (or even the pivot values)
I am trying to replace a column in a pivot table using a drop down or Combo box.
When recording a macro and doing it manually I get this
Sub Macro2()
ActiveSheet.PivotTables("MainPivotTable").CubeFields("[ETO].[Site Manager]"). _
Orientation = xlHidden
With ActiveSheet.PivotTables("MainPivotTable").CubeFields("[ETO].[Suburb]")
.Orientation = xlRowField
.Position = 1
End With
End Sub
I have also found online someone who can change the data source using a combo box
Sub ChangeDataSource()
With ActiveSheet.Shapes(Application.Caller).ControlFormat
ActiveSheet.PivotTables("PivotTable1").PivotTableWizard SourceType:=xlDatabase, SourceData:= _
.List(.Value)
End With
End Sub
Is there a way to modify the second query to change the pivot columns instead (or even the pivot values)