+ Reply to Thread
Results 1 to 3 of 3

VBA: Userform TextBox set to password entry then allow alphanumeric, numeric entry

  1. #1
    Forum Contributor
    Join Date
    02-16-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    108

    Post VBA: Userform TextBox set to password entry then allow alphanumeric, numeric entry

    Hello,

    I have a Userform textbox that I set for password entry, I was hoping to let the user input any password that is... numeric only or, letters only or alphanumeric. Any suggestion is very much appreciated.

    Thank you

  2. #2
    Registered User
    Join Date
    06-04-2012
    Location
    Independence, KY
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: VBA: Userform TextBox set to password entry then allow alphanumeric, numeric entry

    Hi Hudas,

    Try this code

    Sub PasswordButton_Click()
    ' This is a code to let supervisor access reporting
    UserName = InputBox("Enter password to acces data and Report")
    If UserName <> "ste" Then GoTo WrongPassword
    MsgBox " Welcome Hematology Supervisor"
    ReportForm.Show
    MainForm.Hide
    Exit Sub

    WrongPassword:
    MsgBox "Please re-enter password"
    End Sub

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA: Userform TextBox set to password entry then allow alphanumeric, numeric entry

    flexel, your code does not involve a userform & needs code tags adding to it.

    Hudas, a user can type anything into a textbox unless you add code to force say numeric entries only
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1