I have a text box on a user form in Excel in which a user has to enter a password, can you let me know how to code it so that the user must enter only six characters, if six aren't entered I need a msgbox to tell the user it must only be six. Any help would be greatly appreciated
Excel Vba
Collapse
X
-
Tags: None
-
Which part of this have you attempted so far? In VB6, the textbox control has a MaxLength property which will limit the length of what can be typed in. It prevents more than the set amount, so you don't need to test for that. Do you need to check for passwords that are too short?Originally posted by andymerr46I have a text box on a user form in Excel in which a user has to enter a password, can you let me know how to code it so that the user must enter only six characters, if six aren't entered I need a msgbox to tell the user it must only be six. Any help would be greatly appreciated
(Note, what works in VB6 may or may not carry over to Excel VBA). -
Hi ,Originally posted by andymerr46I have a text box on a user form in Excel in which a user has to enter a password, can you let me know how to code it so that the user must enter only six characters, if six aren't entered I need a msgbox to tell the user it must only be six. Any help would be greatly appreciated
Have a look at this link ExcelLink
if this helps out on what you are looking for.
good luck
-ansuman sahuComment
-
Comment