Hi Everyone,
I'm new to Excel so please be gentle.
I'm trying to create a Macro that will allow me to change the values in a pivot table from quantity to net value. However, I keep getting a message that something is wrong the code below.
Macro1 Macro
'
'
Range("B7").Select
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveSheet.PivotTables("PivotTable2").PivotFields("Sum of Billing Qty"). _
Orientation = xlHidden
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("Net Value"), "Count of Net Value", xlCount
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Count of Net Value")
.Caption = "Sum of Net Value"
.Function = xlSum
End With
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
I'm told that the problem is the following code: ActiveSheet.PivotTables("PivotTable2").PivotFields("Sum of Billing Qty"). _
Orientation = xlHidden
However, I'm not sure why.
Any help would be greatly appreciated.
Thanks,
I'm new to Excel so please be gentle.
I'm trying to create a Macro that will allow me to change the values in a pivot table from quantity to net value. However, I keep getting a message that something is wrong the code below.
Macro1 Macro
'
'
Range("B7").Select
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveSheet.PivotTables("PivotTable2").PivotFields("Sum of Billing Qty"). _
Orientation = xlHidden
ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
"PivotTable2").PivotFields("Net Value"), "Count of Net Value", xlCount
With ActiveSheet.PivotTables("PivotTable2").PivotFields("Count of Net Value")
.Caption = "Sum of Net Value"
.Function = xlSum
End With
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
I'm told that the problem is the following code: ActiveSheet.PivotTables("PivotTable2").PivotFields("Sum of Billing Qty"). _
Orientation = xlHidden
However, I'm not sure why.
Any help would be greatly appreciated.
Thanks,