Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Request for a code | Excel Discussion (Misc queries) | |||
Out of Memory: Array Transpose | Excel Programming | |||
Excel SQL.Request restricts data returned to array | Excel Worksheet Functions | |||
quick code request | Excel Programming | |||
Excel: Array & Memory | Excel Programming |