Dim i As Integer Dim j As Integer Dim sort As Integer For i = 1 To 5 For j = i + 1 To 6 If CInt(Me.Controls("TextBox" & i).Text) > CInt(Me.Controls("TextBox" & j).Text) Then sort = Me.Controls("TextBox" & i).Text Me.Controls("TextBox" & i).Text = Me.Controls("TextBox" & j).Text Me.Controls("TextBox" & j).Text = sort End If Next Next