I wish to carry out a custom sort on a selected range at the very end of some standard sorts. So first we sort the range "C", then "R", then "G" and finally I wish to sort on status- which is the custom sort part. But this is going very wrong. I am aware I need a List array aside from that I am unsure how to go about this...please help!
Dim keyRange(1 To 5) As String
keyRange(1) = "L-2sd"
keyRange(2) = "L-1sd"
keyRange(3) = "P"
keyRange(4) = "U+1sd"
keyRange(5) = "U+2sd"
Application.AddCustomList ListArray:=keyRange
sortNum = Application.CustomListCount
'Dim sortNum As Long
ThisWorkbook.Sheets("Order").Activate
ThisWorkbook.Sheets("Order").Range("A1:" & Letter & 10000).Select
Selection.Sort key1:=Range("C"), Order1:=xlAscending,key2:=Range("R"), order2:=xlAscending, key3:=Range("G"), order3:=xlAscending,
key4:=Range("status"), Order1:=xlAscending, OrderCustom:=Application.CustomListCount + 1
Range.Sortonly takes at maximum of 3 keys. You'll need to devise some sort of custom function/procedure to handle the custom aspect of this sort, I think. Or see here for some other suggestions.