Hello
I have made a pivot table with the code below but when i add a new date "rows" the new data didn't appear in the pivot table
how to Fix it ??
I have made a pivot table with the code below but when i add a new date "rows" the new data didn't appear in the pivot table
how to Fix it ??
Code:
Range("A5:S1000").Select
ActiveWorkbook.Worksheets("PIVOT1").PivotTables("PivotTable2").PivotCache. _
CreatePivotTable TableDestination:="PIVOT2!R1C1", TableName:="PivotTable3" _
, DefaultVersion:=xlPivotTableVersion12
Sheets("PIVOT2").Select
Cells(1, 1).Select
With ActiveSheet.PivotTables("PivotTable3").PivotFields("Model")
.Orientation = xlRowField
.Position = 1
End With
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("Qty ONH"), "Sum of Qty ONH", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("Item Amount"), "Sum of Item Amount", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("<=3"), "Sum of <=3", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("<=6"), "Sum of <=6", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("<=9"), "Sum of <=9", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("<=12"), "Sum of <=12", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("<=18"), "Sum of <=18", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("<=24"), "Sum of <=24", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("<=30"), "Sum of <=30", xlSum
ActiveSheet.PivotTables("PivotTable3").AddDataField ActiveSheet.PivotTables( _
"PivotTable3").PivotFields("Provision"), "Sum of Provision", xlSum