LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
KR KR is offline
external usenet poster
 
Posts: 121
Default Request code help, sorting array in memory

I have an array (1 to 100) in memory (I'll never use more than 80-90, but
wanted some extra room just in case). I'm trying to use the following code
to sort the array into alphabetical order before adding the array to a
combobox, but it isn't working. I eliminated all blanks from my array, so
these are just random names in the array (my test set has about 40 names).
Of most importance, I want to sort these names in complete alpha order, even
though the strings are of different length (I'm not sure if that matters, or
how to accomodate if it does, but so far the names don't appear to be
sorting at all)

no matter how I look at it, I just can't figure out what I'm doing wrong.

For i = 99 To 1 Step -1
For j = (i + 1) To 1 Step -1
If FoundNames(i) FoundNames(j) Then
temp = FoundNames(j)
FoundNames(j) = FoundNames(i)
FoundNames(i) = temp
End If
Next
Next

I appreciate your help,
Keith

--
The enclosed questions or comments are entirely mine and don't represent the
thoughts, views, or policy of my employer. Any errors or omissions are my
own.


 
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
Request for a code FARAZ QURESHI Excel Discussion (Misc queries) 0 January 27th 08 02:59 PM
Out of Memory: Array Transpose TheVisionThing Excel Programming 10 May 1st 05 08:47 PM
Excel SQL.Request restricts data returned to array GTSA Excel Worksheet Functions 4 January 11th 05 12:49 AM
quick code request michelle Excel Programming 1 June 23rd 04 09:59 AM
Excel: Array & Memory EG[_2_] Excel Programming 0 September 1st 03 05:29 PM


All times are GMT +1. The time now is 09:00 AM.

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"