I created a userform with Textbox1 on it, I then created code like this to put in the KeyPress event:
<pre>
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case Is < 46
KeyAscii = 8 'character is printed, but we are sending backspace right immediately.
Beep
Case Is > 59
KeyAscii = 8 'character is printed, but we are sending backspace right immediately.
Beep
Case 47 'Backslash character.
KeyAscii = 8 'character is printed, but we are sending backspace right immediately.
Beep
End Select
End Sub</pre>
If you copy and paste this onto your userform, just remember to change "TextBox1" to whatever your text box is called.
This allows only "1234567890" and "." to be entered into the text box.
HTH