ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to set user's input in textbox to be numerical? (https://www.excelbanter.com/excel-programming/360653-how-set-users-input-textbox-numerical.html)

Chwa See Kiap

How to set user's input in textbox to be numerical?
 
i have a Form with a TextBox for user's input.
Can i limit user's input so that only numerical input is acceptable?

THX.



[email protected]

How to set user's input in textbox to be numerical?
 

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 47 Or KeyAscii 58 Then KeyAscii = 0
End Sub

HTH



All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com