Private Sub texto_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
With ActiveControl
If KeyAscii = 46 Or KeyAscii = 44 Then KeyAscii = IIf(InStr(.Value, ",") > 0 Or Len(.Value) = 0, 0, 44)
If Chr(KeyAscii) = "-" And Len(.Value) > 0 Then KeyAscii = 0
If InStr(1, "0123456789,-", Chr(KeyAscii)) = 0 Then KeyAscii = 0
End With
End Sub
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
texto_KeyPress KeyAscii
End Sub
Private Sub TextBox2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
texto_KeyPress KeyAscii
End Sub