Private Sub Command1_Click()
Dim a(6) As Integer
a(1) = 7
a(2) = 3
a(3) = 9
a(4) = 12
a(5) = 20
a(6) = 8
For i = 1 To 5
For j = 1 To 6 - i
If a(j) > a(j + 1) Then
r = a(j)
a(j) = a(j + 1)
a(j + 1) = r
End If
Next j
Next i
For i = 1 To 6
Print a(i);
Next i
End Sub