The sorted array is displayed in the spreadsheet along side the original range used as test data for the inputted array. ( The yellow highlighted range is that produced by the array sort routine, Sub SimpleArraySort3() , and the green highlighted range is that produced by the VBA Range.Sort method routine, Sub Range_Sort()


Ascending Order
Code:
Sub TestieSimpleArraySort3()
 Call SimpleArraySort3(0)
End Sub
'
Code:
Sub Range_Sort()
Rem 0 test data, worksheets info
Dim WsS As Worksheet: Set WsS = ThisWorkbook.Worksheets("Sorting")
Dim RngToSort As range: Set RngToSort = WsS.range("A2:B9")
' alternative:
' Set RngToSort = Selection '                          ' Selection.JPG : https://imgur.com/HnCdBt8
Rem 1 For demo purposes we will sort a copy of the range
 RngToSort.Offset(0, RngToSort.Columns.Count * 2).Clear                                                ' WsS.Columns("E:F").Clear ' CHANGE TO SUIT
 RngToSort.Copy Destination:=RngToSort.Offset(0, RngToSort.Columns.Count * 2)
 Dim RngCopy As range: Set RngCopy = RngToSort.Offset(0, RngToSort.Columns.Count * 2)
 RngCopy.Sort Key1:=RngCopy.Columns("A:A"), Order1:=xlAscending, MatchCase:=False
 'RngCopy.Sort Key1:=RngCopy.Columns("A:A"), Order1:=xlDescending, MatchCase:=False
 Let RngCopy.Interior.Color = vbGreen
End Sub
_____ ( Using Excel 2007 32 bit )
Row\Col
A
B
C
D
E
F
G
1
2
c WasB2
6
WasB7
6
WasB7
3
AB WasB3
32
WasB8
32
WasB8
4
Aa WasB4 A WasB5 A WasB5
5
A WasB5 Aa WasB4 Aa WasB4
6
C WasB6 AB WasB3 AB WasB3
7
6
WasB7 bcde WasB9 bcde WasB9
8
32
WasB8 C WasB6 c WasB2
9
bcde WasB9 c WasB2 C WasB6
10
Worksheet: Sorting



Descending Order
Code:
Sub TestieSimpleArraySort3()
 Call SimpleArraySort3(2246)
End Sub
'
Code:
Sub Range_Sort()
Rem 0 test data, worksheets info
Dim WsS As Worksheet: Set WsS = ThisWorkbook.Worksheets("Sorting")
Dim RngToSort As range: Set RngToSort = WsS.range("A2:B9")
' alternative:
' Set RngToSort = Selection '                          ' Selection.JPG : https://imgur.com/HnCdBt8
Rem 1 For demo purposes we will sort a copy of the range
 RngToSort.Offset(0, RngToSort.Columns.Count * 2).Clear                                                ' WsS.Columns("E:F").Clear ' CHANGE TO SUIT
 RngToSort.Copy Destination:=RngToSort.Offset(0, RngToSort.Columns.Count * 2)
 Dim RngCopy As range: Set RngCopy = RngToSort.Offset(0, RngToSort.Columns.Count * 2)
 'RngCopy.Sort Key1:=RngCopy.Columns("A:A"), Order1:=xlAscending, MatchCase:=False
 RngCopy.Sort Key1:=RngCopy.Columns("A:A"), Order1:=xlDescending, MatchCase:=False
 Let RngCopy.Interior.Color = vbGreen
End Sub
_____ ( Using Excel 2007 32 bit )
Row\Col
A
B
C
D
E
F
G
1
2
c WasB2 c WasB2 c WasB2
3
AB WasB3 C WasB6 C WasB6
4
Aa WasB4 bcde WasB9 bcde WasB9
5
A WasB5 AB WasB3 AB WasB3
6
C WasB6 Aa WasB4 Aa WasB4
7
6
WasB7 A WasB5 A WasB5
8
32
WasB8
32
WasB8
32
WasB8
9
bcde WasB9
6
WasB7
6
WasB7
10
Worksheet: Sorting