Inputbox - display text as asterisk

T

Tim Childs

Hi

please can someone give me the few lines of code required to produce an
inputbox for returning text (for a password) such that each character
entered by the user is shown as an asterisk in the inputbox.

thanks

Tim
 
O

Otto Moehrbach

Tim
Here are a couple of responses given in the past to the same question.
HTH Otto

Not possible. To get a masked password, you would need to create a
UserForm
with a TextBox control. Then you can set the PasswordChar property of
the
TextBox. It would also require some simple macros to display the form
and
act on the password.
John Walkenbach

I don't think this can be done. Any macro would not have control
until
after the user had finished typing, and the prying eyes peeking. You
can

use a text box from the Control toolbox. Set its Password character
property to an asterisk. That will cause asterisks to appear in place
of
characters the user types. Then it will require some code to do stuff
with
the password. And the text box can be hidden when not needed. Or
consider
putting the textbox on a form, instead of a worksheet.
Regards from Virginia Beach,
EarlK
 
J

Jake Marx

Hi Tim,

It's not possible with a standard InputBox. You would have to create a
UserForm, drop a TextBox onto it, and set its PasswordChar property to *.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
V

Vasant Nanavati

Hi Tim:

Set the PasswordChar property of the TextBox to "*".

Regards,

Vasantg.
 
V

Vasant Nanavati

Sorry; didn't read properly. You can't do this with an InputBox; only a
TextBox.
 
T

Tim Childs

Hi Vasant, Jake, Otto

many thanks for the above responses.

Incidentally, I did try using the archives before posting but was
unsuccessful.

Tim
 
Top