PDA

View Full Version : Multi-Dimensional Array Sort



byarbro
04-08-2015, 04:22 PM
Hello,

I am trying to create a multi dimensional array and use a bubble sort to do it. I have five columns and 91 rows. I nee all the info in a row to stay together and it only has to look at one of the columns to sort. Here is how one of the rows looks like.



Denver
Chicago
aa
162
275



So I only need it to be sorted by the third column but i need every value in the row to stay together.
Any help would be greatly appreciated! Thanks

Yongle
04-09-2015, 12:53 AM
How about creating a temporary worksheet, copy the data from the array to that sheet, use Excel to sort it as you want, copy the sorted data back to the array, and finally delete the temporary worksheet

mancubus
04-09-2015, 02:03 AM
you can follow yongle's recommendation.

and you can see older threads on sorting Md arrays...


this:
http://www.vbaexpress.com/forum/showthread.php?12619-Solved-Sorting-Multi-Arrays

or this:
http://www.vbaexpress.com/forum/showthread.php?21265-Solved-Sort-Multidimensional-Array