+ Reply to Thread
Results 1 to 5 of 5

changing password to ****

  1. #1
    Registered User
    Join Date
    01-11-2006
    Posts
    82

    changing password to ****

    Hi,
    I have entered this code. But I want the password to appear in the form of **** when opening the sheet. Is that possible? If yes, please help......your help is appreciated. :smile:


    Private Sub enterpassd()
    Dim pw As String
    Application.ScreenUpdating = False
    pw = InputBox("Please enter Password.")
    If pw = "yourpassword" Then
    With Worksheets("Corporate 99")
    ActiveSheet.Unprotect password:=pw
    .Visible = True
    .Activate
    End With
    Else: MsgBox "The password is incorrect. Please try again."
    End If
    Application.ScreenUpdating = True
    End Sub

    Thanks in advance......

    also please let me know how to put the above code in the code format in this forum...i tried enough.....

  2. #2
    Jim Thomlinson
    Guest

    RE: changing password to ****

    To the best of my knowledge there is no way to change the display text of an
    input box to ***. This can however be done with a text box placed on a form.
    One of the properties of a textbox on a form is Password Character. Set it to
    * and you are ready to go...
    --
    HTH...

    Jim Thomlinson


    "praveen_khm" wrote:

    >
    > Hi,
    > I have entered this code. But I want the password to appear in the form
    > of **** when opening the sheet. Is that possible? If yes, please
    > help......your help is appreciated. :smile:
    >
    >
    > Private Sub enterpassd()
    > Dim pw As String
    > Application.ScreenUpdating = False
    > pw = InputBox("Please enter Password.")
    > If pw = "yourpassword" Then
    > With Worksheets("Corporate 99")
    > ActiveSheet.Unprotect password:=pw
    > .Visible = True
    > .Activate
    > End With
    > Else: MsgBox "The password is incorrect. Please try again."
    > End If
    > Application.ScreenUpdating = True
    > End Sub
    >
    > Thanks in advance......
    >
    > also please let me know how to put the above code in the code format in
    > this forum...i tried enough.....
    >
    >
    > --
    > praveen_khm
    > ------------------------------------------------------------------------
    > praveen_khm's Profile: http://www.excelforum.com/member.php...o&userid=30364
    > View this thread: http://www.excelforum.com/showthread...hreadid=534640
    >
    >


  3. #3
    Jim Rech
    Guest

    Re: changing password to ****

    There is no option with InputBox to have the typed in text appear as
    asterisks. You would have to create a userform with a textbox for entering
    the password. You can set the PasswordChr property of the textbox to
    display asterisks.

    --
    Jim
    "praveen_khm" <[email protected]>
    wrote in message
    news:[email protected]...
    |
    | Hi,
    | I have entered this code. But I want the password to appear in the form
    | of **** when opening the sheet. Is that possible? If yes, please
    | help......your help is appreciated. :smile:
    |
    |
    | Private Sub enterpassd()
    | Dim pw As String
    | Application.ScreenUpdating = False
    | pw = InputBox("Please enter Password.")
    | If pw = "yourpassword" Then
    | With Worksheets("Corporate 99")
    | ActiveSheet.Unprotect password:=pw
    | Visible = True
    | Activate
    | End With
    | Else: MsgBox "The password is incorrect. Please try again."
    | End If
    | Application.ScreenUpdating = True
    | End Sub
    |
    | Thanks in advance......
    |
    | also please let me know how to put the above code in the code format in
    | this forum...i tried enough.....
    |
    |
    | --
    | praveen_khm
    | ------------------------------------------------------------------------
    | praveen_khm's Profile:
    http://www.excelforum.com/member.php...o&userid=30364
    | View this thread: http://www.excelforum.com/showthread...hreadid=534640
    |



  4. #4
    Registered User
    Join Date
    01-11-2006
    Posts
    82
    Thanks both....

    However, I cannot add a text form box now. The only option is to change this code. Ok, is it possible that I can input a textbox using the code and not by going to userform and entering it? The reason is, as I told you already, I cannot add a box. If there is any way that I can enter the textbox and a password using the code, please let me know. If not, thats ok, I ll try manage.....thanx again.......

  5. #5
    Jim Thomlinson
    Guest

    Re: changing password to ****

    I am a little unclear where "as I told you already" comes from but none the
    less. The input box does NOT have a facility to display a password character.
    The only way around it is with a TextBox. You get get this from a form or you
    can embed one in your sheet from the Control Toolbox. If neither of those
    will work for you then I guess you are stuck with what you have...

    As a complete aside, avoid using phrases like "as I told you already". They
    come off as a little offensive. Instead of assuming that we did not read your
    question closely enough you are better off to assume that perhaps you were
    not entirely clear in your request.
    --
    HTH...

    Jim Thomlinson


    "praveen_khm" wrote:

    >
    > Thanks both....
    >
    > However, I cannot add a text form box now. The only option is to change
    > this code. Ok, is it possible that I can input a textbox using the code
    > and not by going to userform and entering it? The reason is, as I told
    > you already, I cannot add a box. If there is any way that I can enter
    > the textbox and a password using the code, please let me know. If not,
    > thats ok, I ll try manage.....thanx again.......
    >
    >
    > --
    > praveen_khm
    > ------------------------------------------------------------------------
    > praveen_khm's Profile: http://www.excelforum.com/member.php...o&userid=30364
    > View this thread: http://www.excelforum.com/showthread...hreadid=534640
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1