Sort MultiDimensional Array

  • Thread starter Thread starter Mushi
  • Start date Start date
M

Mushi

I would like to sort a 5926x12 array. I would like it first sorted by
Column 9-(integer value)-Date
then Column 2 (integer value)-Trailor #
then Column 11 (integer value)-Destination

I want to do this in VBA since that is where the array is. To copy it
to a worksheet, sort, and then reread the array would be time consuming
when the program is ran. I would like the end product to be as if I
had used the "Data", "Sort" command in excel with the Then bys filled
in. Any help would be greatly appreciated. I have searched for this
and have not found a conclusive answer. Thanks.
 
Take your pick of these:
http://www.devx.com/vb2themax/Article/19900

However, given that you can do the same in a couple of lines of code AND a
worksheet, I'd take this option.
Turn off Calculation, .updating etc., and it won't take long. Excel's
algorithm for this type of thing are highly optimised and I'm sure faster
than code you could write in VBA.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top