C
ChuckM
Is there an easy to sort using 4 keys.... I have sorting using 3 keys
working but cannot get 4 keys to work..... the code I use is:
Range(Cells(4, 1), Cells(endrow, 11)).Sort Key1:=Range("F4"),
Order1:=xlAscending, Key2:=Range( _
"C4"), Order2:=xlAscending, Key3:=Range("E4"), Order3:=xlAscending, _
header:=xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=
xlTopToBottom
this works fine, but if I add a 4th key:
Range(Cells(4, 1), Cells(endrow, 11)).Sort Key1:=Range("F4"),
Order1:=xlAscending, Key2:=Range( _
"C4"), Order2:=xlAscending, Key3:=Range("E4"),
Order3:=xlAscending,Key4:=Range("D4"), Order4:=xlAscending, _
header:=xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=
xlTopToBottom
Then I get compilation errors: "Named argument not found" and it
highlights "Key4"
Thanks
Chuck
working but cannot get 4 keys to work..... the code I use is:
Range(Cells(4, 1), Cells(endrow, 11)).Sort Key1:=Range("F4"),
Order1:=xlAscending, Key2:=Range( _
"C4"), Order2:=xlAscending, Key3:=Range("E4"), Order3:=xlAscending, _
header:=xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=
xlTopToBottom
this works fine, but if I add a 4th key:
Range(Cells(4, 1), Cells(endrow, 11)).Sort Key1:=Range("F4"),
Order1:=xlAscending, Key2:=Range( _
"C4"), Order2:=xlAscending, Key3:=Range("E4"),
Order3:=xlAscending,Key4:=Range("D4"), Order4:=xlAscending, _
header:=xlNo, OrderCustom:=1, MatchCase:=False, Orientation:=
xlTopToBottom
Then I get compilation errors: "Named argument not found" and it
highlights "Key4"
Thanks
Chuck