Question : How many sort arguments can I use ?

HI

I was trying to perform the following code:

    Sheets("Shipping").Range("ShippingDetailedItems").Sort Key1:=Range("A8"), Order1:=xlAscending, Key2:=Range("C8"), Order2:=xlAscending, Key3:=Range("D8"), Order3:=xlAscending, Key4:=Range("D8"), Order4:=xlAscending

But it seems that the instruction just allows three sort arguments, I wonder how could I integrate the fourth argument.

Regards.

Answer : How many sort arguments can I use ?

Do the sort in steps:

Sheets("Shipping").Range("ShippingDetailedItems").Sort Key1:=Range("D8"), Order1:=xlAscending
Sheets("Shipping").Range("ShippingDetailedItems").Sort Key1:=Range("A8"), Order1:=xlAscending, Key2:=Range("C8"), Order2:=xlAscending, Key3:=Range("D8"), Order3:=xlAscending

Kevin
Random Solutions  
 
programming4us programming4us