Good morning
I have written 2 pieces of code to align a column in my pivot table by highest / lowest values.
Instead of having 2 buttons (1 for each) is there anyway to adjust so each time the button is pressed it alternates between each value?
Is there a way to join both pieces of code into 1 button?
thanks in advance
I have written 2 pieces of code to align a column in my pivot table by highest / lowest values.
Instead of having 2 buttons (1 for each) is there anyway to adjust so each time the button is pressed it alternates between each value?
Is there a way to join both pieces of code into 1 button?
Code:
Private Sub CommandButton8_Click()
Range("N8").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Agent Name").AutoSort _
xlAscending, "Avg Talk Time", ActiveSheet.PivotTables("PivotTable1"). _
PivotColumnAxis.PivotLines(3), 1
End Sub
Private Sub CommandButton9_Click()
Range("O8").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Agent Name").AutoSort _
xlDescending, "Avg Work Time", ActiveSheet.PivotTables("PivotTable1"). _
PivotColumnAxis.PivotLines(5), 1
End Sub
thanks in advance