Hi Matthew,
1) Yes, break it into sets of 3. Sort the lesser sets first up to the most
important.
2) Yes again, use the Application.Inputbox with a type of 8, and the user
(you?) can then go and select a sort cell and that will be returned by the
inputbox (as an address string) whivh you can pick up in the code.
Dim key1 As Range, key2 As Range, key3 As Range
On Error Resume Next
Set key1 = Application.InputBox("Pick a primary sort key cell", "Sort
criteria", , , , , , 8)
If Not key1 Is Nothing Then
Set key2 = Application.InputBox("Pick a secondary sort key cell",
"Sort criteria", , , , , , 8)
If Not key2 Is Nothing Then
Set key3 = Application.InputBox("Pick a tertiary sort key cell",
"Sort criteria", , , , , , 8)
If Not key3 Is Nothing Then
On Error GoTo 0
Columns("A:C").Sort key1:=key1, _
Order1:=xlAscending, _
key2:=key2, _
Order2:=xlAscending, _
key3:=key3, _
Order3:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom
End If
End If
End If
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)