question

AbhijeetKadam-9319 avatar image
0 Votes"
AbhijeetKadam-9319 asked

vba excel = Column values are not coming as column headings in pivot table

Team
I need pivot for below table. where count of type needs to be displayed against team names something like below. but when I run the below code, the column headings ("not operation", "operation" )does not display. it only shows total count.


team type
bb not operation
aa operation
bb not operation

Pivot
team not operation operation
bb 2
aa 1

     With ActiveSheet.PivotTables("PivotTable2").PivotCache
         .RefreshOnFileOpen = False
         .MissingItemsLimit = xlMissingItemsDefault
     End With
        
     ActiveSheet.PivotTables("PivotTable2").RepeatAllLabels xlRepeatLabels
        
     ActiveWorkbook.ShowPivotTableFieldList = True
     With ActiveSheet.PivotTables("PivotTable2").PivotFields("Team")
         .Orientation = xlRowField
         .Position = 1
     End With
        
     With ActiveSheet.PivotTables("PivotTable2").PivotFields("Type")
         .Orientation = xlColumnField
         .Position =1
     End With
         
     ActiveSheet.PivotTables("PivotTable2").AddDataField ActiveSheet.PivotTables( _
             "PivotTable2").PivotFields("Type"), "Count of Type", _
         xlCount


office-scripts-excel-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers