Results 1 to 10 of 10

Thread: CheckBox to see password

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    Jul 2012
    Posts
    55
    Rep Power
    13

    CheckBox to see password

    Hello,

    I have a userform for entering the password. When entering the password you can only see stars. I want to put a checkbox that if checked would allow to see password and if unchecked to see only stars.
    Can somebody help with.

    Thank you.

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    This goes in Userform module.

    Code:
    Private Sub CheckBox1_Click()
        If Me.CheckBox1.Value Then
            Me.TextBox1.PasswordChar = "*"
        Else
            Me.TextBox1.PasswordChar = vbNullString
        End If
    End Sub
    adjust the checkbox and text box name.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Member
    Join Date
    Jul 2012
    Posts
    55
    Rep Power
    13
    Hi, Admin

    Thank you very much.

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=314837#p314837
    https://www.eileenslounge.com/viewtopic.php?f=21&t=40701&p=314836#p314836
    https://www.eileenslounge.com/viewtopic.php?f=27&t=40621&p=314621#p314621
    https://www.eileenslounge.com/viewtopic.php?f=27&t=40621&p=314619#p314619
    https://www.eileenslounge.com/viewtopic.php?f=27&t=40621&p=314600#p314600
    https://www.eileenslounge.com/viewtopic.php?f=27&t=40621&p=314599#p314599
    https://www.eileenslounge.com/viewtopic.php?f=27&t=40621&p=314274#p314274
    https://www.eileenslounge.com/viewtopic.php?f=27&t=40621&p=314229#p314229
    https://www.eileenslounge.com/viewtopic.php?f=27&t=40621&p=314195#p314195
    https://www.eileenslounge.com/viewtopic.php?f=36&t=39706&p=314110#p314110
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40597&p=314081#p314081
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40597&p=314078#p314078
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=314062#p314062
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40597&p=314054#p314054
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313971#p313971
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313909#p313909
    https://www.eileenslounge.com/viewtopic.php?f=27&t=40574&p=313879#p313879
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313859#p313859
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313855#p313855
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313848#p313848
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313843#p313843
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313792#p313792
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40560&p=313771#p313771
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40560&p=313767#p313767
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40560&p=313746#p313746
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40560&p=313744#p313744
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40560&p=313741#p313741
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313622#p313622
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313575#p313575
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313573#p313573
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313563#p313563
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533&p=313555#p313555
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40533
    https://www.eileenslounge.com/viewtopic.php?f=39&t=40265&p=313468#p313468
    https://www.eileenslounge.com/viewtopic.php?f=42&t=40505&p=313411#p313411
    https://www.eileenslounge.com/viewtopic.php?f=32&t=40473&p=313384#p313384
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40501&p=313382#p313382
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40501&p=313380#p313380
    https://www.eileenslounge.com/viewtopic.php?f=30&t=40501&p=313378#p313378
    https://www.eileenslounge.com/viewtopic.php?f=32&t=40473&p=313305#p313305
    https://www.eileenslounge.com/viewtopic.php?f=44&t=40455&p=313035#p313035
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312889#p312889
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312886#p312886
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312752#p312752
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312734#p312734
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312727#p312727
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312724#p312724
    https://www.eileenslounge.com/viewtopic.php?f=44&t=40374&p=312535#p312535
    https://www.eileenslounge.com/viewtopic.php?p=312533#p312533
    https://www.eileenslounge.com/viewtopic.php?f=44&t=40373&p=312499#p312499
    https://www.youtube.com/watch?v=xLCWtC6UYrM&t=150s
    https://www.excelforum.com/excel-programming-vba-macros/1261394-transfer-specific-columns-from-one-sheet-into-two-sheets.html#post5052448
    http://www.eileenslounge.com/viewtopic.php?f=26&t=38744
    http://www.eileenslounge.com/viewtopic.php?p=175744#p175744
    http://www.eileenslounge.com/viewtopic.php?f=26&t=26030
    http://www.eileenslounge.com/viewtopic.php?p=202322#p202322
    http://www.eileenslounge.com/viewtopic.php?p=276676#p276676
    https://www.pcreview.co.uk/threads/worksheetfunction.977310/#post-2861101
    https://www.pcreview.co.uk/threads/problem-using-vlookup-as-a-function-in-vba.938578/#post-2734072
    https://www.pcreview.co.uk/threads/application-index-application-match.2835125/#post-9344487
    https://www.excelfox.com/forum/showthread.php/2909-Appendix-Thread-Evaluate-Range-(-Codes-for-other-Threads-HTML-Tables-etc-)?p=24055&viewfull=1#post24055
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 03-13-2024 at 03:50 PM.

  4. #4
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    13
    Quote Originally Posted by Admin View Post
    This goes in Userform module.

    Code:
    Private Sub CheckBox1_Click()
        If Me.CheckBox1.Value Then
            Me.TextBox1.PasswordChar = "*"
        Else
            Me.TextBox1.PasswordChar = vbNullString
        End If
    End Sub
    adjust the checkbox and text box name.
    You can shorten that code down to this...

    Code:
    Private Sub CheckBox1_Click()
      TextBox1.PasswordChar = Left("*", -CheckBox1.Value)
    End Sub
    If one plans to type this in instead of copy/pasting it... note the minus sign in front of the CheckBox1.Value argument (it can easily be overlooked).

  5. #5
    Member
    Join Date
    Jul 2012
    Posts
    55
    Rep Power
    13
    Quote Originally Posted by Rick Rothstein View Post
    You can shorten that code down to this...

    Code:
    Private Sub CheckBox1_Click()
      TextBox1.PasswordChar = Left("*", -CheckBox1.Value)
    End Sub
    If one plans to type this in instead of copy/pasting it... note the minus sign in front of the CheckBox1.Value argument (it can easily be overlooked).
    Hello Rick,

    Very nice, but how could I enter the "Me.CheckBox1.Caption =" Password invisible " and " Me.CheckBox1.Caption = "Show Password",when check box is checked or not.
    And if you can tell me: by pressing the OK button to write me in cell A2 password and B2 date, and then in A3 and B3 and so on.

    Thank you.

  6. #6
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    13
    Quote Originally Posted by Ingolf View Post
    Hello Rick,

    Very nice, but how could I enter the "Me.CheckBox1.Caption =" Password invisible " and " Me.CheckBox1.Caption = "Show Password",when check box is checked or not.
    And if you can tell me: by pressing the OK button to write me in cell A2 password and B2 date, and then in A3 and B3 and so on.
    Show me the code you have now (as integrated with the code that Admin posted for you)... that way I don't have to try and guess what you have done or what you actually need.

  7. #7
    Member
    Join Date
    Jul 2012
    Posts
    55
    Rep Power
    13
    Quote Originally Posted by Rick Rothstein View Post
    Show me the code you have now (as integrated with the code that Admin posted for you)... that way I don't have to try and guess what you have done or what you actually need.
    This is the code:
    Code:
    Private Sub CheckBox1_Click()
        If Me.CheckBox1.Value Then
            Me.CheckBox1.Caption = "Password invizible"
            Me.TextBox1.PasswordChar = "*"
            TextBox1.SetFocus
        Else
            Me.CheckBox1.Caption = "Show password"
            Me.TextBox1.PasswordChar = vbNullString
            TextBox1.SetFocus
        End If
    End Sub
    Except line in red I get from Admin.
    Thank you.

  8. #8
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Thanks for the feedback.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Replies: 5
    Last Post: 04-18-2013, 02:30 AM
  2. Password Holder
    By littleiitin in forum Download Center
    Replies: 3
    Last Post: 01-01-2013, 03:22 PM

Posting Permissions

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