Pivot Tables

  • Thread starter Thread starter chaudi
  • Start date Start date
C

chaudi

Hi,

Im trying to create a pivot table in VB but when i run the macro,
instead of summnig the data it seems to count the datapoints. Is there
a way to write a piece of code so that it is forced to sum the data?..

Thanks
Dee
 
You can specify the xlSum function:

With ActiveSheet.PivotTables(1).PivotFields("Units")
.Orientation = xlDataField
.Caption = "TotalUnits"
.Function = xlSum
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top