drsudhakar
New Member
- Joined
- Jan 25, 2018
- Messages
- 6
Dear all
I want to generate multiple columns in Pivot table from single data column with each data type as a column header. I could do pivot table, but not sure how to proceed on this.
'Insert Row Fields
With ActiveSheet.PivotTables("PT1").PivotFields("username")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("CTypeDesc")
.Orientation = xlRowField
.Position = 2
End With
'Insert column Fields
With ActiveSheet.PivotTables("PT1").PivotFields("CTypeDesc")
.Orientation = xlPageField
.Position = 2
End With
With ActiveSheet.PivotTables("PT1").PivotFields("CTypeDesc")
.Orientation = xlColumnField
.Position = 1
End With
'Insert Data Field
ActiveSheet.PivotTables("PT1").AddDataField ActiveSheet.PivotTables( _
"PT1").PivotFields("CTypeDesc"), "Count of CTypeDesc", _
xlCount
I am amateur in VBA. I am hopeful, if somebody could kindly help. Thanks in advance for your time and help.
regards
drsudhakar
I want to generate multiple columns in Pivot table from single data column with each data type as a column header. I could do pivot table, but not sure how to proceed on this.
'Insert Row Fields
With ActiveSheet.PivotTables("PT1").PivotFields("username")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable4").PivotFields("CTypeDesc")
.Orientation = xlRowField
.Position = 2
End With
'Insert column Fields
With ActiveSheet.PivotTables("PT1").PivotFields("CTypeDesc")
.Orientation = xlPageField
.Position = 2
End With
With ActiveSheet.PivotTables("PT1").PivotFields("CTypeDesc")
.Orientation = xlColumnField
.Position = 1
End With
'Insert Data Field
ActiveSheet.PivotTables("PT1").AddDataField ActiveSheet.PivotTables( _
"PT1").PivotFields("CTypeDesc"), "Count of CTypeDesc", _
xlCount
I am amateur in VBA. I am hopeful, if somebody could kindly help. Thanks in advance for your time and help.
regards
drsudhakar