Dim num(9) As Integer
Dim i As Integer
Dim j, middle As Integer
For i = 0 To 9
num(i) = Rnd() * 90 + 10
Next i
For i = 1 To 9
If num(i) > num(i - 1) Then
middle = num(i)
'j=i-1
'Do While j >= 0
' If num(i) > num(j) Then
' num(j + 1) = num(j)
' j = j - 1
' Else
' Exit Do
' End If
'Loop
For j = i - 1 To 0 Step -1
If num(i) > num(j) Then
num(j + 1) = num(j)
Else
Exit For
End If
Next
num(j) = middle
End If
Next i