Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr(1, TextBox1.Text, ".") > 0 And KeyAscii = Asc(".") Then
KeyAscii = 0
Exit Sub
End If
Select Case KeyAscii
Case Asc("0") To Asc("9"), Asc(".")
Case Else
KeyAscii = 0
End Select
End Sub