Looks like nice work. What columns or exact cells did you want to sort and sort ascending or descending?
This code shows C5 sorting both ways. I did not know which you wanted or how you wanted to run it. Mainly, one records a macro and then sets the sheet's Protect options as explained earlier to get started.
The code can be cleaned up a bit but with ListObjects(), table, code is a bit more involved. Luckily, the macro recorder makes doing it fairly easy.
Code:
Sub Macro2()
'c5 sorts...
ActiveSheet.Unprotect
ActiveWorkbook.Worksheets("Svc Line Analysis").ListObjects("InptTotal").Sort. _
SortFields.Clear
ActiveWorkbook.Worksheets("Svc Line Analysis").ListObjects("InptTotal").Sort. _
SortFields.Add Key:=Range("InptTotal[[#All],[ TOTAL INPATIENT BY MDC]]"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Svc Line Analysis").ListObjects("InptTotal"). _
Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Svc Line Analysis").ListObjects("InptTotal").Sort. _
SortFields.Clear
ActiveWorkbook.Worksheets("Svc Line Analysis").ListObjects("InptTotal").Sort. _
SortFields.Add Key:=Range("InptTotal[[#All],[ TOTAL INPATIENT BY MDC]]"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Svc Line Analysis").ListObjects("InptTotal"). _
Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub