ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   putting validation to TextBox in the userform (https://www.excelbanter.com/excel-programming/292632-putting-validation-textbox-userform.html)

salihyil[_8_]

putting validation to TextBox in the userform
 
hello guys

i use userform to autofilter the data from the list. when i put the
username it just filters the usernames details.

Question:
does anyone know how to put validation to textbox. eg just letters. if
end-user puts number, i want system to show an error message.

and also if the text that will be put in textbox does not exist in
(data,list)i want system to show error messege.

if you can help i will appriciate guys

thanks
:) :(


---
Message posted from http://www.ExcelForum.com/


serkan

putting validation to TextBox in the userform
 
Here's the code you'll need...

Private Sub TextBox1_Change()
If TextBox1 = vbNullString Then Exit Sub
If IsNumeric(TextBox1) Then
MsgBox "Sorry, text only"
TextBox1 = vbNullString
End If
End Sub



-----Original Message-----
hello guys

i use userform to autofilter the data from the list. when

i put the
username it just filters the usernames details.

Question:
does anyone know how to put validation to textbox. eg

just letters. if
end-user puts number, i want system to show an error

message.

and also if the text that will be put in textbox does not

exist in
(data,list)i want system to show error messege.

if you can help i will appriciate guys

thanks
:) :(


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 02:05 PM.

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