I am getting error while running a vb activity.
And getting this error.
Can anyone help please?
@supermanPunch @ushu @Gokul001 @Anil_G
@Kunal_Jain can you post excel and vba code here?
Dim PT As PivotTable
Set PT = ActiveSheet.PivotTables(“PivotTable6”)
.Orientation = xlLabelOnly
.SortOnValue = True
.SortOrder = xlAscending
I am sorry but I cannot share the excel sheet because it contain sensitive data.
make sure your pivot table is the correct name i.e. PivotTable6. If its wrong, change name and run again
if the name is correct, try use this code instead
Sub SortPivotColumn() Dim PT As PivotTable Set PT = ActiveSheet.PivotTables("PivotTable6") With PT .PivotFields("Branch/Plant").Orientation = xlRowField .PivotFields("Branch/Plant").AutoSort xlAscending, "Branch/Plant" End With End Sub
It had given me the desired output
no problem! good luck
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.