Option Explicit

 

Private Sub cmdOrd_Click()

    Dim a As Long, b As Long

    a = Val(txtA.Text)

    b = Val(txtB.Text)

    If a > b Then

        Troca2 a, b

    End If

    txtA.Text = a

    txtB.Text = b

End Sub

 

Private Sub cmdSair_Click()

    End

End Sub

 

Sub Troca2(x As Long, y As Long)

    Dim aux As Long

    aux = x

    x = y

    y = aux

End Sub