Excel Vba

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andymerr46
    New Member
    • Jun 2007
    • 2

    Excel Vba

    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
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by andymerr46
    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
    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?

    (Note, what works in VB6 may or may not carry over to Excel VBA).

    Comment

    • ansumansahu
      New Member
      • Mar 2007
      • 149

      #3
      Originally posted by andymerr46
      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
      Hi ,

      Have a look at this link ExcelLink
      if this helps out on what you are looking for.

      good luck
      -ansuman sahu

      Comment

      • andymerr46
        New Member
        • Jun 2007
        • 2

        #4
        Originally posted by ansumansahu
        Hi ,

        Have a look at this link ExcelLink
        if this helps out on what you are looking for.

        good luck
        -ansuman sahu
        Thanks for your help guys, all sorted
        Regards
        Andy

        Comment

        Working...