The snippet is given

Dim arr1(4) As String ' Given Array

Dim arr2(4) As String ' Sorted Array

arr1(0) = "M"

arr1(1) = "G"

arr1(2) = "H"

arr1(3) = "S"

arr1(4) = "A"

' Adding array to listbox

For i = 0 To UBound(arr1)

List1.AddItem arr1(i)

Next i

' Getting the sorted array

For i = 0 To (List1.ListCount - 1)

arr2(i) = List1.List(i)

Next i

For i = 0 To UBound(arr2)

Msgbox arr2(i)

Next i