Reputation: 87
I'm currently working on a project where I import rows from another excel file into my pivot table. The pivot table include a total row (that can be removed thanks to a checkbox), but I'd like to do it automatically with vba. Do you know a code that could work and remove this row, then add it again as last raw after the importation?
Thank you guys.
Upvotes: 0
Views: 195
Reputation: 12279
Did you not try recording a macro before asking this? I just did this and got the following:
With ActiveSheet.PivotTables("PivotTable1")
.ColumnGrand = False
.RowGrand = False
End With
Just tailor this to your sheet and pivot table.
Upvotes: 1