Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sort an array

What's the code for sorting an array? For example, my array looks lik
this: <20, <5, <60, <9. I want to have it in this order: <5, <9, <20
<60.

Thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default sort an array

your values appear to be text. Text would sort as

<20
<5
<60
<9

If you want a numberical sort, you could insert a column next to your data
and use a formula like

=--(Right(A1,Len(A1)-1) [drag fill down the column]

Then sort both columns using the column with the formulas as the sort key.

--
Regards,
Tom Ogilvy


"clui" wrote in message
...
What's the code for sorting an array? For example, my array looks like
this: <20, <5, <60, <9. I want to have it in this order: <5, <9, <20,
<60.

Thanks!


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sort an array

Further to the answer below i am not quite clear how that answer sorts
an array. It appears to sort a range.

I have a similar problem:

How do i sort an array which contains 7 columns and 1,000,000 rows of
numeric data.
I bascially need to re-order the rows in ascending order based on the
value of the final column in the row.

eg.
1,1,2,3,4,6,99.78
2,3,4,5,6,1,12.34
2,1,3,4,2,2,10000.56
...

to give:
2,3,4,5,6,1,12.34
1,1,2,3,4,6,99.78
2,1,3,4,2,2,10000.56
...

How do i then take the top 50 rows into excel and delete the rest?

Thanks

N


---
Message posted from http://www.ExcelForum.com/

Reply
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
Array extended formula - sort yshridhar Excel Worksheet Functions 3 January 7th 08 07:45 AM
UDF to sort array with multiple columns flygis Excel Worksheet Functions 0 June 2nd 06 06:00 PM
An Array To Sort Blank Cell travelersway New Users to Excel 5 March 3rd 06 12:25 AM
Array... Sort of... Egon Excel Worksheet Functions 2 October 19th 05 05:47 PM
Trouble to sort an array in Excel using VBA choco140 Excel Programming 1 August 15th 03 07:24 AM


All times are GMT +1. The time now is 03:07 PM.

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

About Us

"It's about Microsoft Excel"