Hi all,
I have a question about pivot tables. I have automatically generated a pivot table and depending on the inputs, the pivot table sometimes sets itself to count and other times sets itself to sum. I would like to add some code in so that it will check for the state and change it to Sum. Here is what I have tried. Thank you in advance!
I have a question about pivot tables. I have automatically generated a pivot table and depending on the inputs, the pivot table sometimes sets itself to count and other times sets itself to sum. I would like to add some code in so that it will check for the state and change it to Sum. Here is what I have tried. Thank you in advance!
Code:
If ActiveSheet.PivotTables("X Offset PT").PivotFields("Sum of X Offset").Function _
= xlCount Then
ActiveSheet.PivotTables("X Offset PT").PivotFields("Count of X Offset"). _
Function = xlSum
Else: End If