Format Cell as Password

R

Richard_123

Hello,

Is there any way to format a cell so that it displays what is typed in as a
password (ie. as *****) rather than showing what has been typed in?

Thanks
 
H

Harald Staff

No. Problem is; no macros runs while writing stuff into a cell. Can you
enter your password into something else? A userform textbox would be
perfect. What is this for?

Best wishes Harald
 
G

Gord Dibben

Event code OK?

Private Sub Worksheet_Change(ByVal Target As Range)
Dim v As Variant, i As Integer
If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub
If IsNumeric(Target) Then
MsgBox "all numbers not allowed"
Else
On Error GoTo CleanUp
Application.EnableEvents = False
v = Target(1, 1).Value
Application.EnableEvents = False
For i = 1 To Len(v)
Target(1, 1).Characters(Start:=i, _
Length:=1).Text = "*"
Next i
End If
CleanUp:
Application.EnableEvents = True
End Sub

Note: the text will be seen while entering but change to ***** when enter
key is hit.

To have text appear as ****** while typing is beyond my skills.

I don't think you can do that in a cell.



Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top