This one's driving me nuts. I have code to sort the active sheet of an xlsm file. Below is the code:
It works for the first three, I think because those columns have cells that start with numbers. How can I get columns E and F to sort from A to Z?
Thanks
Rich (BB code):
Rich (BB code):
Rich (BB code):
Rich (BB code):
With ActiveSheet.Sort
.SortFields.AddKey:=Range("A2:A75000"), Order:=xlAscending
.SortFields.AddKey:=Range("B2:B750000"), Order:=xlAscending
.SortFields.AddKey:=Range("C2:C75000"), Order:=xlAscending
.SortFields.AddKey:=Range("E2:E75000"), Order:=xlAscending
.SortFields.AddKey:=Range("F2:F750000"), Order:=xlAscending
.SetRangeRange("A2:AO70000")
.Header = xlYes
.Apply
End With
End Sub
It works for the first three, I think because those columns have cells that start with numbers. How can I get columns E and F to sort from A to Z?
Thanks
Last edited: