


As below method does not work when you use the CreatePivotTable() method from a Pivot Cache that was Set using the Add method. Then on Show Values As tab select Running Total In, And Select the column header you wish to Group By. On the Summarize Values By tab, Select SUM. Under Value Filed Settings you can find the settings you need. It all depends on what method you use to create your Pivot table. Running Total is a built in function for Pivot Tables. PivotFields("Order #").Subtotals(1) = TrueĪnother way is to set each PivotField Subtotal attribute to false as you create the fields. PivotFields("Order #").Subtotals(1) = FalseĪccording to Excel 2013 Pivot Table Data Crunching you can turn on the first subtotal, and this method automatically disables all the other subtotals, hence: it is not working for me. PivotFields("Order #").Subtotals(1) = True If MsgBox("Delete the PivotTable?", vbYesNo) = vbYes ThenĪlso I just added MACRO DesigningPivotTable: Sub DesigningPivotTable() ' Prompt the user whether to delete the PivotTable. Set objField = objTable.PivotFields("Carrier") Set objField = objTable.PivotFields("Qty")

Set objField = objTable.PivotFields("Ship Date") Set objField = objTable.PivotFields("PO#") Set objField = objTable.PivotFields("Packing/Inv#") PivotTable Tools Click Design > Grand Totals. Set objField = objTable.PivotFields("Tracking #") Show or hide grand totals Click anywhere in the PivotTable to show the PivotTable Tools on the ribbon. SELECT region, value FROM YourData UNION ALL SELECT Grand Total AS region, SUM (value) AS value FROM YourData GROUP BY Grand Total. Start in a separate workbook from the data. Set objField = objTable.PivotFields("Part #") If creating manually, via the external data option at the first step of the pivot table wizard (ALT-D-P). Set objField = objTable.PivotFields("Supplier") ' Create the PivotTable object based on the Employee data on Sheet1. ' Select the sheet and first cell of the table that contains the data.ĪctiveWorkbook.Sheets("Employees").Select ' method to specify the fields in the PivotTable.ĭim objTable As PivotTable, objField As PivotField So there is no way to get around this unless the Grand Total calculation was done by the formula (sum all profit / sum all revenue). ' by using the PivotTableWizard method with the PivotFields ' Creates a PivotTable report from the table on Sheet1 To show grand totals at top in rows and columns, set the GrandTotalsPosition property in PivotViewDataSourceSettings to Top. I want to remove the subtotals of the pivot table. I am converting a table into Pivot and then to a CSV file.
