Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim strValidChars As String
Dim strTitle As String
Dim strCharLetter As String
strCharLetter = UCase(Chr$(KeyAscii))
'Cambiando strValidChar se puede usar para filtrar
'cualquier conjunto de caracteres
strValidChars = "0123456789.,"
If InStr(strValidChars, strCharLetter) Then
KeyAscii = Asc(strCharLetter)
ElseIf KeyAscii = 8 Or KeyAscii = 13 Then
Else
'Opcional, si deseas darle un aviso al usuario
'Lo puedes eliminar
strTitle = "+ Convención +"
MsgBox "Escriba solo números, puntos o comas.", vbInformation, strTitle
KeyAscii = 0
End If
End Sub