View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default text box validation

Test it on input

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
Select Case KeyCode
Case 48 To 57:
Case Else: KeyCode = 0
End Select
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"kastoras" wrote in message
...
Hi everyone,

I want to validate a textbox in vba. I want a textbox to accept only
numbers, not text.

I would really appreciate any kind of help or hint


Lefkios