To add to romperstomper might be worth adding an If statement using version as a criteria
Range("E5").Activate
If Application.Version >= 12 Then
ActiveWorkbook.Worksheets("BranchList").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("BranchList").Sort.SortFields.Add Key:=Range("E5"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("BranchList").Sort
.SetRange Range("B6:AE65513")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Else
With ActiveWorkbook.Worksheets("BranchList")
.Range("B6:AE65513").Sort Key1:=.Range("E5"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End With
End If
Bookmarks