none
Sort 2 Dimensional Array RRS feed

  • Question

  • Thanks for taking the time to read my question.

    I found this array sorting code here: https://stackoverflow.com/questions/4873182/sorting-a-multidimensionnal-array-in-vba

    My understanding of it is that I should be able to pass my array to it from another sub and the array should be resorted and when I return to my sub, I can use the resorted array as I need.

    Before:

    420, 1
    1250, 2
    820, 3

    Should become:

    420, 1
    820, 3
    1250, 2

    but the array just stays in the same order.

    I've called the array sorting code like this:
    QuickSortArray tVis, , , 2
    and
    QuickSortArray tVis, , , 1

    Any thoughts? If I can just get the array to be sorted I'm off to the races!

    Thanks


    • Edited by mbrad Tuesday, February 26, 2019 2:09 PM
    Tuesday, February 26, 2019 2:08 PM

Answers

  • Hi,

    I took out all optional parameters and the code now sorts the array as I need.

    I hope this helps someone.

    Thanks!

    • Marked as answer by mbrad Tuesday, February 26, 2019 2:26 PM
    Tuesday, February 26, 2019 2:26 PM