Gentlemen,
I try to build sorting code, but I face error message '9'
The code,
Sub Sort()
Application.ScreenUpdating = False
Sheets("PivotTable1").PivotTables("PivotTable1").PivotFields("Emp Name").AutoSort _
[drpSortMethod].Value, [usSortStat].Value, Sheets("PivotTable1").PivotTables("PivotTable1"). _
PivotColumnAxis.PivotLines([drpSortStat].Value), 1
Application.ScreenUpdating = True
End Sub
drpSortStat 3
usSortStat Average of % with team Avg
drpSortMethod 1
usSortMethod Ascending
Bookmarks