Sort array

How to i sort this array in ascending order using vba?

Array unsorted = [6,8,20,34,1,867,3,1,1,65,9,6,23,9,0];
mustish1Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
test this code


Sub sortArray()
Dim vArr() As String, myArrayList  As Object, j As Integer, str As String
str = "6,8,20,34,1,867,3,1,1,65,9,6,23,9,0"
 Set myArrayList = CreateObject("System.Collections.ArrayList")
vArr = Split(str, ",")
For j = 0 To UBound(vArr)
    myArrayList.Add CInt(vArr(j))
Next
myArrayList.Sort
Debug.Print Join(myArrayList.ToArray, ",")
End Sub
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
cool!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.