Hello
Using Excel 2010
I have these two pieces of code below that put 2 fields into the page area of a pivot table.
I want to choose 2 out of 40 items in OrderID
I want to choose 1 out of 20 items in CustomerID
Is this possible without having to write true vs false code for each item in VBA?
Any alternative code greatly appreciated.
'Insert Page Fields
With ActiveSheet.PivotTables("SalesPivotTable").PivotFields("OrderID")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("SalesPivotTable").PivotFields("CustomerID")
.Orientation = xlPageField
.Position = 2
End With
Thank you
Eric
Using Excel 2010
I have these two pieces of code below that put 2 fields into the page area of a pivot table.
I want to choose 2 out of 40 items in OrderID
I want to choose 1 out of 20 items in CustomerID
Is this possible without having to write true vs false code for each item in VBA?
Any alternative code greatly appreciated.
'Insert Page Fields
With ActiveSheet.PivotTables("SalesPivotTable").PivotFields("OrderID")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("SalesPivotTable").PivotFields("CustomerID")
.Orientation = xlPageField
.Position = 2
End With
Thank you
Eric