Solved

How to sum several pivot table values instantly

Posted on 2016-10-26
2
32 Views
Last Modified: 2016-10-26
Dear experts,

Please advise what is the easiest way to sum instantly a pivot table with several columns in value field.

Thank you.
0
Comment
Question by:Leonardo M
2 Comments
 
LVL 5

Accepted Solution

by:
Yamaafg earned 500 total points
ID: 41859880
Hi,

One way to do it is using VBA.

Try below vba:

Public Sub PivotFieldsToSum()
 
Dim ptf As PivotField
With Selection.PivotTable
.ManualUpdate = True
For Each ptf In .DataFields
With ptf
.Function = xlSum
.NumberFormat = "#,##0"
End With
Next ptf
.ManualUpdate = False
End With
End Sub
0
 

Author Comment

by:Leonardo M
ID: 41859881
Thank you, worked perfect!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ms access 2010 vba, copy table from db1 to db2 from db3 27 46
Access 2016 7 33
Basic Excel DataEntry for Dashboard analysis 3 25
Criteria for Date for DCount 4 20
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question