# ArrSort_5Arr and ArrSort_7Arr

2 functions to sort 5 Arrays or 7 Arrays respectively.

CodeFunctionName
What is this?
##### Public Tested Original Work

Function ArrSort_5Arr(arrShort, ByRef arrSub, ByRef arrSub2, ByRef ArrSub3, ByRef ArrSub4, Order_1Asc_2Desc, Optional CaseSensative = 1)
Ord1 = 1
If Order_1Asc_2Desc = 2 Then Ord1 = 2
For I = UBound(arrShort) - 1 To 0 Step -1
For J = 0 To I
If CaseSensative = 1 Then
Cond1 = arrShort(J) > arrShort(J + 1)
If Ord1 = 2 Then Cond1 = arrShort(J) < arrShort(J + 1)
Else
Arritem1 = UCase(arrShort(J))
Arritem2 = UCase(arrShort(J + 1))
Cond1 = Arritem1 > Arritem2
If Ord1 = 2 Then Cond1 = Arritem1 < Arritem2
End If
If Cond1 Then
temp = arrShort(J + 1):                arrShort(J + 1) = arrShort(J):                            arrShort(J) = temp
temp1 = arrSub(J + 1):                arrSub(J + 1) = arrSub(J):                                arrSub(J) = temp1
temp2 = arrSub2(J + 1):                arrSub2(J + 1) = arrSub2(J):                            arrSub2(J) = temp2
temp3 = ArrSub3(J + 1):                ArrSub3(J + 1) = ArrSub3(J):                            ArrSub3(J) = temp3
temp4 = ArrSub4(J + 1):                ArrSub4(J + 1) = ArrSub4(J):                            ArrSub4(J) = temp4
End If
Next
Next
ArrSort_5Arr = arrShort
End Function

Function ArrSort_7Arr(arrShort, ByRef arrSub, ByRef arrSub2, ByRef ArrSub3, ByRef ArrSub4, ByRef ArrSub5, ByRef ArrSub6, Order_1Asc_2Desc, Optional CaseSensative = 1)
Ord1 = 1
If Order_1Asc_2Desc = 2 Then Ord1 = 2
For I = UBound(arrShort) - 1 To 0 Step -1
For J = 0 To I
If CaseSensative = 1 Then
Cond1 = arrShort(J) > arrShort(J + 1)
If Ord1 = 2 Then Cond1 = arrShort(J) < arrShort(J + 1)
Else
Arritem1 = UCase(arrShort(J))
Arritem2 = UCase(arrShort(J + 1))
Cond1 = Arritem1 > Arritem2
If Ord1 = 2 Then Cond1 = Arritem1 < Arritem2
End If
If Cond1 Then
temp = arrShort(J + 1):                arrShort(J + 1) = arrShort(J):                            arrShort(J) = temp
temp1 = arrSub(J + 1):                arrSub(J + 1) = arrSub(J):                                arrSub(J) = temp1
temp2 = arrSub2(J + 1):                arrSub2(J + 1) = arrSub2(J):                            arrSub2(J) = temp2
temp3 = ArrSub3(J + 1):                ArrSub3(J + 1) = ArrSub3(J):                            ArrSub3(J) = temp3
temp4 = ArrSub4(J + 1):                ArrSub4(J + 1) = ArrSub4(J):                            ArrSub4(J) = temp4
temp5 = ArrSub5(J + 1):                ArrSub5(J + 1) = ArrSub5(J):                            ArrSub5(J) = temp5
temp6 = ArrSub6(J + 1):                ArrSub6(J + 1) = ArrSub6(J):                            ArrSub6(J) = temp6
End If
Next
Next
ArrSort_7Arr = arrShort
End Function
arrShort, ByRef arrSub, ByRef arrSub2, ByRef ArrSub3, ByRef ArrSub4, Order_1Asc_2Desc, Optional CaseSensative = 1
And
arrShort, ByRef arrSub, ByRef arrSub2, ByRef ArrSub3, ByRef ArrSub4, ByRef ArrSub5, ByRef ArrSub6, Order_1Asc_2Desc, Optional CaseSensative = 1