I have a problem with pivot table, where the column fields are in 2 levels: Year and Item. In the rows area is a City field, and the Amount field is in the Value area. In this case the correct values are summarized for each year.
Now I would like to show a % difference from previous year. I...
I found the solution. After setting the total calculation, just turn on, turn off and turn on again the total row. :(
Using Excel 2010
.ShowTotals = True
.ShowTotals = False
.ShowTotals = True
Normally when you add a total row to a listobject manually, they will accept the filter on the table.
When I add a total row by VBA:
With ActiveSheet.ListObjects("Table1")
.ShowTotals = True
.ListColumns("Qty").TotalsCalculation = xlTotalsCalculationSum...
My code (fragment):
Sub CreatePivotZakazky()
Dim PTCache As PivotCache
Dim PT As PivotTable
Application.DisplayAlerts = False
If WorksheetExists("Zakázky") Then
Sheets("Zakázky").Select
Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete...