Calculadora Básica Formula Exel

Páginas: 2 (352 palabras) Publicado: 31 de agosto de 2011
Programador exel ,Visual Basic

Dim ope As String
Dim n1 As Long
Dim fact As Long
Dim mb As Long

OPERACIONES
Private Sub clear_Click()
r.Text = ""
End Sub

Private Sub entre_Click()n1 = CInt(r.Text)
r.Text = ""
ope = "division"
End Sub

Private Sub facto_Click()
Dim n As Integer
n = CInt(r.Text)
fact = 1
Do While (n > 1)
fact = fact * n
n = n - 1
Loop
r.Text = factEnd Sub

BOTON IGUAL

Private Sub igual_Click()
If (ope = "suma") Then
r.Text = n1 + CInt(r.Text)
End If

If (ope = "potencia") Then
n1 = r.Text
r.Text = r.Text * n1 * n1
End If


If(ope = "resta") Then
r.Text = n1 - r.Text
If r.Text < 0 Then
r.Text = r.Text * -1
End If
End If

If (ope = "division") Then
r.Text = n1 / CInt(r.Text)
End If

If (ope = "multiplicacion")Then
r.Text = n1 * CInt(r.Text)
End If

End Sub

Private Sub mas_Click()
n1 = CInt(r.Text)
r.Text = ""
ope = "suma"
End Sub

Private Sub mc_Click()
mb = ""
End Sub

Private Submenos_Click()
n1 = CInt(r.Text)
r.Text = ""
ope = "resta"
End Sub

Private Sub mmas_Click()
mb = mb - r.Text
End Sub

Private Sub mmenos_Click()
mb = mb + r.Text
End Sub

Private Sub mr_Click()mb = r.Text
End Sub

Private Sub num0_Click()
r.Text = r.Text + "0"
End Sub

NÚMEROS

Private Sub num1_Click()
r.Text = r.Text + "1"
End Sub

Private Sub num2_Click()
r.Text = r.Text+ "2"
End Sub

Private Sub num3_Click()
r.Text = r.Text + "3"
End Sub

Private Sub num4_Click()
r.Text = r.Text + "4"
End Sub

Private Sub num5_Click()
r.Text = r.Text + "5"
End SubPrivate Sub num6_Click()
r.Text = r.Text + "6"
End Sub

Private Sub num7_Click()
r.Text = r.Text + "7"
End Sub

Private Sub num8_Click()
r.Text = r.Text + "8"
End Sub

Private Subnum9_Click()
r.Text = r.Text + "9"
End Sub

Private Sub pi_Click()
r.Text = 3.14159265358979
End Sub
Private Sub por_Click()
n1 = CInt(r.Text)
r.Text = ""
ope = "multiplicacion"
End Sub

Private...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Formulas De Exel
  • formulas de exel
  • Formulas exel
  • Formulas De Exel
  • formulas exel
  • Formulas Calculo
  • Formulas Calculadoras
  • Formulas Calculo

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS