LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Sort array

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.

--
Regards,
Tom Ogilvy



"slim" wrote:


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.


--
slim
------------------------------------------------------------------------
slim's Profile: http://www.excelforum.com/member.php...o&userid=28643
View this thread: http://www.excelforum.com/showthread...hreadid=525357




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort an array Gary''s Student Excel Programming 1 February 7th 06 02:47 PM
sort 2D array Greg Excel Programming 0 February 6th 06 09:31 PM
sort 2D array Greg Excel Programming 1 February 6th 06 09:29 PM
sort an array Greg Excel Programming 6 February 6th 06 04:07 AM
Sort an Array [email protected] Excel Programming 0 November 18th 04 01:20 AM


All times are GMT +1. The time now is 06:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"