PivotCache

N

Nick

I am having a problem when I create a pivot table using a
PivotCache in my VBA code. Sometimes when I add a data
field it summrrizes with a COUNT and sometimes with a
SUM. Is there a line of code that I can put when creating
the Pivot Table to ensure that it does a SUM each time?

Thank you in advance for any help you can offer

Here is an example of what my code currently looks like:
With PivotCache
.PivotFields("PRODMONTH").Orientation = xlRowField
.PivotFields("RECVOL").Orientation = xlDataField
.PivotFields("Data").Orientation = xlColumnField
 

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

Top