• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1255
  • Last Modified:

Excel VBA Inputbox password

I have a condition that makes users opening the workbook put in their name, their title, then if they hold certain titles they get asked a password.  This all works perfect.  However to get the password I use a Inputbox.  It allows anyone to look over your shoulder and see what your password is, is there a way using the VBA to make that box scramble, or replace the char's with a single char so that is not visible. And I would like to have this run every time they type a letter.  That way it works just like password inputs on other programs.  And thanks.
0
rrhunt28
Asked:
rrhunt28
  • 4
  • 3
1 Solution
 
Steve KnightIT ConsultancyCommented:
You can use a user form.  Create a form and add a text box then you can set the PasswordChar property of the field to * say and it will just show a * for each character entered.

If you need help with this let us know.

Steve
0
 
rrhunt28Author Commented:
I will check that out and let you know man, thank you.
0
 
rrhunt28Author Commented:
Well, i figured that part out, and it makes sense to do it that way.  However I am still having a problem getting it to work this way.  I have one user form that asks for their title, then if that title is "Manger" it prompts for a password.  I tried doing this code with a seperate user form.  And now I am trying it using the same user form, but only having the password part be visible if the choice is "Manager".  I want it to only allow them to try the password 3 times before it exits excel.  
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Steve KnightIT ConsultancyCommented:
OK, with EE emails down all over the place I've only just stumbled back across your feedback...

So you've got a form with username/password inputboxes.  Once a name is entered then if it is manager then presuambly you are seting the visible property of the password box to true in lostfocus etc. then do something similar in teh password box keeping a counter of tries (reset when you change teh user name.... and exit the app if you try too manyt imes.

Just going through a mound of EE emails now, will look back in a bit !

Steve
0
 
rrhunt28Author Commented:
Yes when value = "manager" i set the boxes to .visible
0
 
rrhunt28Author Commented:
I used your * in the input box, but I got the rest figured out, thank you for the help.
0
 
Steve KnightIT ConsultancyCommented:
Well thanks for the points anyway, sorry I hadn't helped more but when emails are down (and then come back up and leave us with hundreds...) there is such a delay between comments and feedback both ways things often end up getting sorted out so yourself I appreciate still awarding the points.

Glad to see you have it working now anyway.

Steve
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now