View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Format Cell as Password

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

On Mon, 8 Dec 2008 13:02:01 -0800, Richard_123
wrote:

Is there any other way of doing it? such as writing a macro?

Thank you.

"Harald Staff" wrote:

No, that can not be done by cell formatting, sorry.

Best wishes Harald

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