|
Bueno Gustavo te agradezco la ayudo, finalmente pude solucionar el tema de las operaciones matematicas (aqui te envio un ejemplo de la suma) gracias por tu ayuda.
Private Sub txtNumeros_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii <> 8 And (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> Asc("+") And KeyAscii <> Asc("-") Then
KeyAscii = 0
End If
MsgBox KeyAscii.Value
If KeyAscii.Value = 13 Then
a = Len(txtNumeros.Text) 'aca me da el largo del texto
cadena = txtNumeros.Text
aux1 = 0
aux2 = 0
For i = 1 To a + 1 'recorro todo el string
deauno = Mid(cadena, i, 1)
If deauno <> "+" And i <= a Then
num = num + deauno
' (Mid(cadena, i, 1))
aux1 = CInt(num)
Else
aux2 = aux2 + aux1 ' aca guardo la primera cifra
aux1 = 0
num = ""
End If
Next
txtNumeros.Text = aux2
Command1.SetFocus
End If
End Sub
|