Private Sub Command1_Click() Dim A, B As Double If Val(Me.Text1.Text) - Val(Me.Text2) > 0 Then A = Me.Text1 Else A = Me.Text2.Text End If If Val(Me.Text3.Text) - Val(Me.Text4) > 0 Then B = Me.Text3 Else B = Me.Text4.Text End If If A - B > 0 Then Me.Text5 = A Else Me.Text5.Text = B End If