What's wrong with standard Excel sort (which is usually much quicker than VBA
sorts)?
> Hey,
>
[quoted text clipped - 6 lines]
>
> Thanks in advance.
Why not use RangeObj.Sort method to do the sorting? You are not sorting an
array, so I think a custom sort algorithm, like bubble sort, is not relevant
in your case.
Frederick Chow
Hong Kong.
> Hey,
>
[quoted text clipped - 6 lines]
>
> Thanks in advance.
slim - 22 Mar 2006 18:45 GMT
Hey, thanks for replying.
I've solved the problem now with a handy bit of code from Microsoft!
Sub SortRange()
Dim MyErr As Label
On Error GoTo MyErr
Selection.Sort Key1:=Range("N5"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
MyErr:
Select Case Err
Case 0
'Everything is OK
Case Else
MsgBox Err.Description
End Select
Err.Clear
End Sub
Thanks for your help
Tom Ogilvy - 22 Mar 2006 19:58 GMT
Just for interest:
You could have gotten code like that by turning on the macro recorder,
selecting your range and do Data=>sort and specifying your parameters. Then
turn off the macro recorder.

Signature
Regards,
Tom Ogilvy
> Hey, thanks for replying.
>
[quoted text clipped - 18 lines]
>
> Thanks for your help.