View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default TextBox that only accepts integers?

Hi

Exit is too late. Use the Keypress event. Set keyascii to 0 if its < 48 or
57.


Except (tricky part coming up): Keydown event to trap and validate Ctrl V.

HTH. Best wishes Harald

"Claud Balls" skrev i melding
...
What would be the best way to check that text is a positive whole
number? I'm thinking about putting it in the textbox_exit event.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!