ActiveWorkbook.Worksheets("Sheet1").ListObjects("SalesTable").Sort.SortFields. _
Add2 Key:=Range("B2"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Sheet1").ListObjects("SalesTable").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Sheet1").ListObjects("SalesTable").Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("Sheet1").ListObjects("SalesTable").Sort.SortFields. _
Add2 Key:=Range("SalesTable[Country]"), SortOn:=xlSortOnValues, Order:= _
xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Sheet1").ListObjects("SalesTable").Sort.SortFields. _
Add2 Key:=Range("SalesTable[City]"), SortOn:=xlSortOnValues, Order:= _
xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("Sheet1").ListObjects("SalesTable").Sort.SortFields. _
Add2 Key:=Range("SalesTable[Sales Person]"), SortOn:=xlSortOnValues, Order _
:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").ListObjects("SalesTable").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Selection.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(4, 5), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(4, 5), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal GroupBy:=3, Function:=xlSum, TotalList:=Array(4, 5), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True