Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case 45 'negative
If Len(Trim(TextBox1.Text)) > 1 Then
Beep
KeyAscii = 0
End If
Case 46 'period
If InStr(TextBox1.Text, ".") > 0 Then
Beep
KeyAscii = 0
End If
Case 48 To 57 'numbers
If InStr(TextBox1.Text, ".") > 0 Then
If Len(TextBox1.Text) > InStr(TextBox1.Text, ".") + 1 Then
Beep
KeyAscii = 0
End If
End If
Case Else 'Discard anything else
Beep
KeyAscii = 0
End Select
End Sub
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)