Some folks told that a two-dimensional array can solve almost all the problems, but let me disagree with that. That's why I made this Deca dimensional array sort function. The array must be symmetrical, meaning that it must contain elements corresponding to all the existing elements in the other dimensions.I didn't put any error handler, because depending on usage purposes, it can take different shapes.I tried for several days to find a way to avoid such multiple statements by using an on-the-fly variable generator to replace the index of array in the loop. I didn't succeeded, so the question is: did someone know a way to replace the seqArr(i) = arr(s(0), i, s(2) with: seqArr(i) = something based on the s variable (which already is generating the same result)?The improvement I need is regarding the length of the code. Actually the code is limited to 10 dimensions because of its length, with a solution regarding repetitive statement in the loop it can be extended to an unlimited number of dimensions.I also don't want to use Microsoft scripting runtime library on this.Function SortArray(ByRef arr As Variant, ByVal selPoint As Variant, ByRef selDim As Integer, Optional ByRef ascend As Boolean = True) As Variant'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Deca Dimensional Ascending and Descending Array Sort Function'Inputs:'1) arr         = one to 10 dimensional symmetrical array'2) selPoint    = selected point index as string e.g. arr(1,15,4) or just (1,15,4)'3) selDim      = selected dimension, integer from 1 to 10'4) ascend      = Optional ascending or descending direction (default = ascending)'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''Dim seq As Variant, seqArr As Variant, s As VariantDim i As Integer, j As Integer, arrDim As IntegerOn Error Resume NextDo    arrDim = arrDim + 1    seq = UBound(arr, arrDim)Loop Until Err.Number <> 0arrDim = arrDim - 1On Error GoTo 0ReDim seq(UBound(arr, selDim))For i = LBound(seq) To UBound(seq)seq(i) = iNext i'following array is already generating necessary array index but'I didn't find a way to use it to avoid such multiple statementss = Split(Split(selPoint, ()(1), ))(0)s = Split(s, ,)selPoint = For i = 1 To arrDimIf i = selDim Then selPoint = selPoint & i, Else selPoint = selPoint & s( & i - 1 & ),Next iReDim seqArr(0)For i = LBound(seq) To UBound(seq)ReDim Preserve seqArr(i)If arrDim = 1 ThenseqArr(i) = arr(s(0))ElseIf arrDim = 2 And selDim = 1 ThenseqArr(i) = arr(i, s(1))ElseIf arrDim = 2 And selDim = 2 ThenseqArr(i) = arr(s(0), i)ElseIf arrDim = 3 And selDim = 1 ThenseqArr(i) = arr(i, s(1), s(2))ElseIf arrDim = 3 And selDim = 2 ThenseqArr(i) = arr(s(0), i, s(2))ElseIf arrDim = 3 And selDim = 3 ThenseqArr(i) = arr(s(0), s(1), i)ElseIf arrDim = 4 And selDim = 1 ThenseqArr(i) = arr(i, s(1), s(2), s(3))ElseIf arrDim = 4 And selDim = 2 ThenseqArr(i) = arr(s(0), i, s(2), s(3))ElseIf arrDim = 4 And selDim = 3 ThenseqArr(i) = arr(s(0), s(1), i, s(3))ElseIf arrDim = 4 And selDim = 4 ThenseqArr(i) = arr(s(0), s(1), s(2), i)ElseIf arrDim = 5 And selDim = 1 ThenseqArr(i) = arr(i, s(1), s(2), s(3), s(4))ElseIf arrDim = 5 And selDim = 2 ThenseqArr(i) = arr(s(0), i, s(2), s(3), s(4))ElseIf arrDim = 5 And selDim = 3 ThenseqArr(i) = arr(s(0), s(1), i, s(3), s(4))ElseIf arrDim = 5 And selDim = 4 ThenseqArr(i) = arr(s(0), s(1), s(2), i, s(4))ElseIf arrDim = 5 And selDim = 5 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), i)ElseIf arrDim = 6 And selDim = 1 ThenseqArr(i) = arr(i, s(1), s(2), s(3), s(4), s(5))ElseIf arrDim = 6 And selDim = 2 ThenseqArr(i) = arr(s(0), i, s(2), s(3), s(4), s(5))ElseIf arrDim = 6 And selDim = 3 ThenseqArr(i) = arr(s(0), s(1), i, s(3), s(4), s(5))ElseIf arrDim = 6 And selDim = 4 ThenseqArr(i) = arr(s(0), s(1), s(2), i, s(4), s(5))ElseIf arrDim = 6 And selDim = 5 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), i, s(5))ElseIf arrDim = 6 And selDim = 6 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), i)ElseIf arrDim = 7 And selDim = 1 ThenseqArr(i) = arr(i, s(1), s(2), s(3), s(4), s(5), s(6))ElseIf arrDim = 7 And selDim = 2 ThenseqArr(i) = arr(s(0), i, s(2), s(3), s(4), s(5), s(6))ElseIf arrDim = 7 And selDim = 3 ThenseqArr(i) = arr(s(0), s(1), i, s(3), s(4), s(5), s(6))ElseIf arrDim = 7 And selDim = 4 ThenseqArr(i) = arr(s(0), s(1), s(2), i, s(4), s(5), s(6))ElseIf arrDim = 7 And selDim = 5 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), i, s(5), s(6))ElseIf arrDim = 7 And selDim = 6 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), i, s(6))ElseIf arrDim = 7 And selDim = 7 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), i)ElseIf arrDim = 8 And selDim = 1 ThenseqArr(i) = arr(i, s(1), s(2), s(3), s(4), s(5), s(6), s(7))ElseIf arrDim = 8 And selDim = 2 ThenseqArr(i) = arr(s(0), i, s(2), s(3), s(4), s(5), s(6), s(7))ElseIf arrDim = 8 And selDim = 3 ThenseqArr(i) = arr(s(0), s(1), i, s(3), s(4), s(5), s(6), s(7))ElseIf arrDim = 8 And selDim = 4 ThenseqArr(i) = arr(s(0), s(1), s(2), i, s(4), s(5), s(6), s(7))ElseIf arrDim = 8 And selDim = 5 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), i, s(5), s(6), s(7))ElseIf arrDim = 8 And selDim = 6 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), i, s(6), s(7))ElseIf arrDim = 8 And selDim = 7 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), i, s(7))ElseIf arrDim = 8 And selDim = 8 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), s(6), i)ElseIf arrDim = 9 And selDim = 1 ThenseqArr(i) = arr(i, s(1), s(2), s(3), s(4), s(5), s(6), s(7), s(8))ElseIf arrDim = 9 And selDim = 2 ThenseqArr(i) = arr(s(0), i, s(2), s(3), s(4), s(5), s(6), s(7), s(8))ElseIf arrDim = 9 And selDim = 3 ThenseqArr(i) = arr(s(0), s(1), i, s(3), s(4), s(5), s(6), s(7), s(8))ElseIf arrDim = 9 And selDim = 4 ThenseqArr(i) = arr(s(0), s(1), s(2), i, s(4), s(5), s(6), s(7), s(8))ElseIf arrDim = 9 And selDim = 5 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), i, s(5), s(6), s(7), s(8))ElseIf arrDim = 9 And selDim = 6 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), i, s(6), s(7), s(8))ElseIf arrDim = 9 And selDim = 7 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), i, s(7), s(8))ElseIf arrDim = 9 And selDim = 8 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), s(6), i, s(8))ElseIf arrDim = 9 And selDim = 9 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), s(6), s(7), i)ElseIf arrDim = 10 And selDim = 1 ThenseqArr(i) = arr(i, s(1), s(2), s(3), s(4), s(5), s(6), s(7), s(8), s(9))ElseIf arrDim = 10 And selDim = 2 ThenseqArr(i) = arr(s(0), i, s(2), s(3), s(4), s(5), s(6), s(7), s(8), s(9))ElseIf arrDim = 10 And selDim = 3 ThenseqArr(i) = arr(s(0), s(1), i, s(3), s(4), s(5), s(6), s(7), s(8), s(9))ElseIf arrDim = 10 And selDim = 4 ThenseqArr(i) = arr(s(0), s(1), s(2), i, s(4), s(5), s(6), s(7), s(8), s(9))ElseIf arrDim = 10 And selDim = 5 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), i, s(5), s(6), s(7), s(8), s(9))ElseIf arrDim = 10 And selDim = 6 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), i, s(6), s(7), s(8), s(9))ElseIf arrDim = 10 And selDim = 7 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), i, s(7), s(8), s(9))ElseIf arrDim = 10 And selDim = 8 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), s(6), i, s(8), s(9))ElseIf arrDim = 10 And selDim = 9 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), s(6), s(7), i, s(9))ElseIf arrDim = 10 And selDim = 10 ThenseqArr(i) = arr(s(0), s(1), s(2), s(3), s(4), s(5), s(6), s(7), s(8), i)ElseEnd IfNext iseq = SortSeq(seqArr, seq, LBound(seq), UBound(seq), ascend)SortArray = ParseArray(arr, seq, selDim)End FunctionPrivate Function SortSeq(ByRef iArr As Variant, ByRef sArr As Variant, ByRef iDnRow As Long, ByRef iUpRow As Long, Optional ByRef ascend As Boolean = True) As VariantDim oArr As Variant, vArr As VariantDim vDnRow As Long, vUpRow As LongvDnRow = iDnRowvUpRow = iUpRowoArr = iArr((iDnRow + iUpRow) \ 2)While (vDnRow <= vUpRow)If ascend = True Then    While (iArr(vDnRow) < oArr And vDnRow < iUpRow)       vDnRow = vDnRow + 1    Wend    While (oArr < iArr(vUpRow) And vUpRow > iDnRow)       vUpRow = vUpRow - 1    WendElse    While (iArr(vDnRow) > oArr And vDnRow < iUpRow)       vDnRow = vDnRow + 1    Wend    While (oArr > iArr(vUpRow) And vUpRow > iDnRow)       vUpRow = vUpRow - 1    WendEnd IfIf (vDnRow <= vUpRow) Then   vArr = iArr(vDnRow)   iArr(vDnRow) = iArr(vUpRow)   iArr(vUpRow) = vArr   vArr = sArr(vDnRow)   sArr(vDnRow) = sArr(vUpRow)   sArr(vUpRow) = vArr   vDnRow = vDnRow + 1   vUpRow = vUpRow - 1End IfWendIf (iDnRow < vUpRow) Then SortSeq iArr, sArr, iDnRow, vUpRow, ascendIf (vDnRow < iUpRow) Then SortSeq iArr, sArr, vDnRow, iUpRow, ascendSortSeq = sArrEnd FunctionPrivate Function ParseArray(ByRef baseArray As Variant, ByRef seq As Variant, ByRef d As Integer) As VariantDim selDim As Integer, baseDim As IntegerDim d1 As Integer, d2 As Integer, d3 As Integer, d4 As Integer, d5 As IntegerDim d6 As Integer, d7 As Integer, d8 As Integer, d9 As Integer, d10 As IntegerDim tmpArray As VariantOn Error Resume NextDo    baseDim = baseDim + 1    tmpArray = UBound(baseArray, baseDim)Loop Until Err.Number <> 0baseDim = baseDim - 1On Error GoTo 0tmpArray = baseArrayselDim = 1For d1 = LBound(baseArray, selDim) To UBound(baseArray, selDim)    If baseDim > selDim Then    selDim = selDim + 1    For d2 = LBound(baseArray, selDim) To UBound(baseArray, selDim)        If baseDim > selDim Then        selDim = selDim + 1        For d3 = LBound(baseArray, selDim) To UBound(baseArray, selDim)            If baseDim > selDim Then            selDim = selDim + 1            For d4 = LBound(baseArray, selDim) To UBound(baseArray, selDim)                If baseDim > selDim Then                selDim = selDim + 1                For d5 = LBound(baseArray, selDim) To UBound(baseArray, selDim)                    If baseDim > selDim Then                    selDim = selDim + 1                    For d6 = LBound(baseArray, selDim) To UBound(baseArray, selDim)                        If baseDim > selDim Then                        selDim = selDim + 1                        For d7 = LBound(baseArray, selDim) To UBound(baseArray, selDim)                            If baseDim > selDim Then                            selDim = selDim + 1                            For d8 = LBound(baseArray, selDim) To UBound(baseArray, selDim)                                If baseDim > selDim Then                                selDim = selDim + 1                                For d9 = LBound(baseArray, selDim) To UBound(baseArray, selDim)                                    If baseDim > selDim Then                                    selDim = selDim + 1                                    For d10 = LBound(baseArray, selDim) To UBound(baseArray, selDim)                                            If d = 1 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(seq(d1), d2, d3, d4, d5, d6, d7, d8, d9, d10)                                            ElseIf d = 2 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, seq(d2), d3, d4, d5, d6, d7, d8, d9, d10)                                            ElseIf d = 3 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, d2, seq(d3), d4, d5, d6, d7, d8, d9, d10)                                            ElseIf d = 4 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, d2, d3, seq(d4), d5, d6, d7, d8, d9, d10)                                            ElseIf d = 5 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, d2, d3, d4, seq(d5), d6, d7, d8, d9, d10)                                            ElseIf d = 6 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, d2, d3, d4, d5, seq(d6), d7, d8, d9, d10)                                            ElseIf d = 7 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, d2, d3, d4, d5, d6, seq(d7), d8, d9, d10)                                            ElseIf d = 8 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, d2, d3, d4, d5, d6, d7, seq(d8), d9, d10)                                            ElseIf d = 9 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, d2, d3, d4, d5, d6, d7, d8, seq(d9), d10)                                            ElseIf d = 10 Then                                            baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10) = tmpArray(d1, d2, d3, d4, d5, d6, d7, d8, d9, seq(d10))                                            Else                                            End If                                    Next d10                                    selDim = selDim - 1                                    Else                                        If d = 1 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(seq(d1), d2, d3, d4, d5, d6, d7, d8, d9)                                        ElseIf d = 2 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(d1, seq(d2), d3, d4, d5, d6, d7, d8, d9)                                        ElseIf d = 3 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(d1, d2, seq(d3), d4, d5, d6, d7, d8, d9)                                        ElseIf d = 4 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(d1, d2, d3, seq(d4), d5, d6, d7, d8, d9)                                        ElseIf d = 5 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(d1, d2, d3, d4, seq(d5), d6, d7, d8, d9)                                        ElseIf d = 6 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(d1, d2, d3, d4, d5, seq(d6), d7, d8, d9)                                        ElseIf d = 7 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(d1, d2, d3, d4, d5, d6, seq(d7), d8, d9)                                        ElseIf d = 8 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(d1, d2, d3, d4, d5, d6, d7, seq(d8), d9)                                        ElseIf d = 9 Then                                        baseArray(d1, d2, d3, d4, d5, d6, d7, d8, d9) = tmpArray(d1, d2, d3, d4, d5, d6, d7, d8, seq(d9))                                        Else                                        End If                                    End If                                Next d9                                selDim = selDim - 1                                Else                                    If d = 1 Then                                    baseArray(d1, d2, d3, d4, d5, d6, d7, d8) = tmpArray(seq(d1), d2, d3, d4, d5, d6, d7, d8)                                    ElseIf d = 2 Then                                    baseArray(d1, d2, d3, d4, d5, d6, d7, d8) = tmpArray(d1, seq(d2), d3, d4, d5, d6, d7, d8)                                    ElseIf d = 3 Then                                    baseArray(d1, d2, d3, d4, d5, d6, d7, d8) = tmpArray(d1, d2, seq(d3), d4, d5, d6, d7, d8)                                    ElseIf d = 4 Then                                    baseArray(d1, d2, d3, d4, d5, d6, d7, d8) = tmpArray(d1, d2, d3, seq(d4), d5, d6, d7, d8)                                    ElseIf d = 5 Then                                    baseArray(d1, d2, d3, d4, d5, d6, d7, d8) = tmpArray(d1, d2, d3, d4, seq(d5), d6, d7, d8)                                    ElseIf d = 6 Then                                    baseArray(d1, d2, d3, d4, d5, d6, d7, d8) = tmpArray(d1, d2, d3, d4, d5, seq(d6), d7, d8)                                    ElseIf d = 7 Then                                    baseArray(d1, d2, d3, d4, d5, d6, d7, d8) = tmpArray(d1, d2, d3, d4, d5, d6, seq(d7), d8)                                    ElseIf d = 8 Then                                    baseArray(d1, d2, d3, d4, d5, d6, d7, d8) = tmpArray(d1, d2, d3, d4, d5, d6, d7, seq(d8))                                    Else                                    End If                                End If                            Next d8                            selDim = selDim - 1                            Else                                If d = 1 Then                                baseArray(d1, d2, d3, d4, d5, d6, d7) = tmpArray(seq(d1), d2, d3, d4, d5, d6, d7)                                ElseIf d = 2 Then                                baseArray(d1, d2, d3, d4, d5, d6, d7) = tmpArray(d1, seq(d2), d3, d4, d5, d6, d7)                                ElseIf d = 3 Then                                baseArray(d1, d2, d3, d4, d5, d6, d7) = tmpArray(d1, d2, seq(d3), d4, d5, d6, d7)                                ElseIf d = 4 Then                                baseArray(d1, d2, d3, d4, d5, d6, d7) = tmpArray(d1, d2, d3, seq(d4), d5, d6, d7)                                ElseIf d = 5 Then                                baseArray(d1, d2, d3, d4, d5, d6, d7) = tmpArray(d1, d2, d3, d4, seq(d5), d6, d7)                                ElseIf d = 6 Then                                baseArray(d1, d2, d3, d4, d5, d6, d7) = tmpArray(d1, d2, d3, d4, d5, seq(d6), d7)                                ElseIf d = 7 Then                                baseArray(d1, d2, d3, d4, d5, d6, d7) = tmpArray(d1, d2, d3, d4, d5, d6, seq(d7))                                Else                                End If                            End If                        Next d7                        selDim = selDim - 1                        Else                            If d = 1 Then                            baseArray(d1, d2, d3, d4, d5, d6) = tmpArray(seq(d1), d2, d3, d4, d5, d6)                            ElseIf d = 2 Then                            baseArray(d1, d2, d3, d4, d5, d6) = tmpArray(d1, seq(d2), d3, d4, d5, d6)                            ElseIf d = 3 Then                            baseArray(d1, d2, d3, d4, d5, d6) = tmpArray(d1, d2, seq(d3), d4, d5, d6)                            ElseIf d = 4 Then                            baseArray(d1, d2, d3, d4, d5, d6) = tmpArray(d1, d2, d3, seq(d4), d5, d6)                            ElseIf d = 5 Then                            baseArray(d1, d2, d3, d4, d5, d6) = tmpArray(d1, d2, d3, d4, seq(d5), d6)                            ElseIf d = 6 Then                            baseArray(d1, d2, d3, d4, d5, d6) = tmpArray(d1, d2, d3, d4, d5, seq(d6))                            Else                            End If                        End If                    Next d6                    selDim = selDim - 1                    Else                        If d = 1 Then                        baseArray(d1, d2, d3, d4, d5) = tmpArray(seq(d1), d2, d3, d4, d5)                        ElseIf d = 2 Then                        baseArray(d1, d2, d3, d4, d5) = tmpArray(d1, seq(d2), d3, d4, d5)                        ElseIf d = 3 Then                        baseArray(d1, d2, d3, d4, d5) = tmpArray(d1, d2, seq(d3), d4, d5)                        ElseIf d = 4 Then                        baseArray(d1, d2, d3, d4, d5) = tmpArray(d1, d2, d3, seq(d4), d5)                        ElseIf d = 5 Then                        baseArray(d1, d2, d3, d4, d5) = tmpArray(d1, d2, d3, d4, seq(d5))                        Else                        End If                    End If                Next d5                selDim = selDim - 1                Else                    If d = 1 Then                    baseArray(d1, d2, d3, d4) = tmpArray(seq(d1), d2, d3, d4)                    ElseIf d = 2 Then                    baseArray(d1, d2, d3, d4) = tmpArray(d1, seq(d2), d3, d4)                    ElseIf d = 3 Then                    baseArray(d1, d2, d3, d4) = tmpArray(d1, d2, seq(d3), d4)                    ElseIf d = 4 Then                    baseArray(d1, d2, d3, d4) = tmpArray(d1, d2, d3, seq(d4))                    Else                    End If                End If            Next d4            selDim = selDim - 1            Else                If d = 1 Then                baseArray(d1, d2, d3) = tmpArray(seq(d1), d2, d3)                ElseIf d = 2 Then                baseArray(d1, d2, d3) = tmpArray(d1, seq(d2), d3)                ElseIf d = 3 Then                baseArray(d1, d2, d3) = tmpArray(d1, d2, seq(d3))                Else                End If            End If        Next d3        selDim = selDim - 1        Else            If d = 1 Then            baseArray(d1, d2) = tmpArray(seq(d1), d2)            ElseIf d = 2 Then            baseArray(d1, d2) = tmpArray(d1, seq(d2))            Else            End If        End If    Next d2    selDim = selDim - 1    Else    baseArray(d1) = tmpArray(seq(d1))    End IfNext d1ParseArray = baseArrayEnd FunctionA simple test sub:Sub testSortArray()Dim arr As VariantReDim arr(1, 1, 5)arr(0, 0, 0) = 0arr(0, 0, 1) = 1arr(0, 0, 2) = 2arr(0, 0, 3) = 3arr(0, 0, 4) = 4arr(0, 0, 5) = 5arr(0, 1, 0) = 10arr(0, 1, 1) = 11arr(0, 1, 2) = 12arr(0, 1, 3) = 13arr(0, 1, 4) = 14arr(0, 1, 5) = 15arr(1, 0, 0) = 100arr(1, 0, 1) = 101arr(1, 0, 2) = 102arr(1, 0, 3) = 103arr(1, 0, 4) = 104arr(1, 0, 5) = 105arr(1, 1, 0) = 110arr(1, 1, 1) = 111arr(1, 1, 2) = 112arr(1, 1, 3) = 113arr(1, 1, 4) = 114arr(1, 1, 5) = 115'arr = SortArray(arr, arr(0,1,0), 1, False)'arr = SortArray(arr, arr(0,1,0), 2, False)arr = SortArray(arr, arr(0,1,0), 3, False)End Sub
Deca dimensional ascending and descending array sort function
array;vba;excel