Thread: Sort on 3 keys
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Janis Janis is offline
external usenet poster
 
Posts: 360
Default Sort on 3 keys

the division header field is 15,1
dept header field is 16,1
status header field is 17,1

I want this to sort on all 3 in this order. The sort doesn't work
thanks,

Sub SortDivDept()
'sorts by Divsion, Department & Status

Dim Rng As Range

Set Rng = Range("A1:Q1")
With ActiveSheet
Rng.Sort key1:=Cells(15, 1), key2:=Cells(16, 1), key3:=Cells(17, 1),
Orientation:=xlSortColumns, MatchCase:=False
End With

End Sub