Hi Rob,
While I wouldn't necessarily be too concerned about code length for the sake of only that, you certainly have a lot of lines that can be cleaned up. Unless you like watching the mouse scroll we can wipe all the ActiveWindow.ScrollColumn lines, as that's all they do.
I've cleaned up your code for you, and added the second sortfield I think you're looking for. Give this a go and let me know if it works for you:
Code:Sub SortMe() With Worksheets("AB Vehicles") .Range("A2:BC1000").Select .Sort.SortFields.Clear .Sort.SortFields.Add Key:=Range("A2"), SortOn:=xlSortOnValues, Order:=xlAscending .Sort.SortFields.Add Key:=Range("B2"), SortOn:=xlSortOnValues, Order:=xlAscending With ActiveWorkbook.Worksheets("AB Vehicles").Sort .SetRange Range("A2:BC1000") .Header = xlNo .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With End With End Sub
Bookmarks