You are on page 1of 1

Private Sub btncalcular_Click()

Dim n1, n2, res


n1 = Val(txtn1)
n2 = Val(txtn2)

If (chksuma.Value = True) Then


chkresta.Value = False
chkmultiplicacion.Value = False
chkdividir.Value = False

res = n1 + n2
Range("a1").Select
ActiveCell.FormulaR1C1 = res
End If

If (chkresta.Value = True) Then


chkmultiplicacion.Value = False
chkdividir.Value = False
chksuma.Value = False
res = n1 - n2
Range("a1").Select
ActiveCell.FormulaR1C1 = res
End If

If (chkmultiplicacion.Value = True) Then


chkdividir.Value = False
chksuma.Value = False
chkresta.Value = False
res = n1 * n2
Range("a1").Select
ActiveCell.FormulaR1C1 = res
End If

If (chkdividir.Value = True) Then


chksuma.Value = False
chkresta.Value = False
chkmultiplicacion.Value = False
res = n1 / n2
Range("a1").Select
ActiveCell.FormulaR1C1 = res

End If

End Sub

Private Sub chkresta_Click()

End Sub

You might also like