Show Password Characters

Don't you hate it when you go to a website and type your password and you're not sure if you typed the right thing, but the password is masked so you have to backspace over it and type the whole thing over again?

Sometimes the site will let you display the characters you typed, but usually not. I highlight the password and paste it into Notepad so I can see what I typed, but that never works. Excel does let you do that, sort of.

The TextBox.PasswordChar Property lets you specify a character that masks text input. This is so often used for entering passwords that they named the field after it. The best part is you can toggle this property to alternately mask and display input, letting your users reveal what they typed and correct mistakes.

I created a sample userform to test this functionality.

password character form

Start typing in the textbox and the input will be masked with "*"'s. Choose the character you want to use for masking and then click the Toggle button. The text you type will be alternately displayed and then masked with whatever character you choose.

Download sample workbook

About JP

I'm just an average guy who writes VBA code for a living. This is my personal blog. Excel and Outlook are my thing, with a sprinkle of Access and Word here and there. Follow this space to learn more about VBA. Keep Reading »


Related Articles:


Share This Article:

Share and bookmark this articledelicious buttonfacebook buttonlinkedin buttonstumbleupon buttontwitter button

comment bubble 5 Comment(s) on Show Password Characters:

  1. how can I download the worksheet?

  2. JP great stuff thank you very much for sharing it. Thanks for your site it great practical stuff…….cheers

  3. JP with your password Characters sheet. Is the idea that if you are in a site's dialog box or other software that you copy the password into your User Form so you can see what you have typed? And I guess type your password into your User form and copy it elsewhere. I am assuming its not meant to pop up anywhere just in Excel right?
    cheers

    • Not really. It's just an exercise to show how you can toggle textbox fields to alternately display and hide passwords — something most websites won't let you do. I didn't actually try to copy something from the web and paste it into the form to see if it will reveal hidden characters.

This article is closed to any future comments.
Peltier Tech Charting Utilities for Excel