ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inputbox - display text as asterisk (https://www.excelbanter.com/excel-programming/285328-inputbox-display-text-asterisk.html)

Tim Childs

Inputbox - display text as asterisk
 
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




Otto Moehrbach[_6_]

Inputbox - display text as asterisk
 
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

"Tim Childs" wrote in message
...
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








Jake Marx[_3_]

Inputbox - display text as asterisk
 
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]


Tim Childs wrote:
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



Vasant Nanavati

Inputbox - display text as asterisk
 
Hi Tim:

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

Regards,

Vasantg.


"Tim Childs" wrote in message
...
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






Vasant Nanavati

Inputbox - display text as asterisk
 
Sorry; didn't read properly. You can't do this with an InputBox; only a
TextBox.

--

Vasant

"Tim Childs" wrote in message
...
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






Tim Childs

Inputbox - display text as asterisk
 
Hi Vasant, Jake, Otto

many thanks for the above responses.

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

Tim

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Sorry; didn't read properly. You can't do this with an InputBox; only a
TextBox.

--

Vasant

"Tim Childs" wrote in message
...
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









All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com