Option Explicit
Private Sub Command1_Click()
Dim a(10) As Integer, s() As Integer, i As Integer
Dim j As Integer, st As String
For i = 1 To 10
a(i) = Int(Rnd * 90) + 10
Text1.Text = Text1 & Str(a(i))
Next i
ReDim s(1)
s(1) = a(1)
List1.AddItem Str(s(1))
For i = 2 To 10
st = ""
Call sort(a(i), s)
For j = i To UBound(s)
st = st & Str(s(j))
Next j
List1.AddItem st
Next i
End Sub
Private Sub sort(n As Integer, s() As Integer)
Dim i As Integer, j As Integer, k As Integer
k = UBound(s)
ReDim Preserve s(k + 1)
For i = 1 To k
If n <= s(i) Then
For j = k To i Step -1
s(j + 1) = s(j)
Next j
s(i) = n: Exit Sub
End If
Next i
s(i) = n
End Sub