+ Reply to Thread
Results 1 to 7 of 7

how to unprotect sheet using - prompting user input

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    Tucson, US
    MS-Off Ver
    Excel 2003
    Posts
    6

    how to unprotect sheet using - prompting user input

    I need a solution to unprotect by user if he suplied the password by typing in input box.

    my code:--
    Please Login or Register  to view this content.
    -- once it is locked .. when i try to edit something .. it says sheet is protected message..
    what I need is to promt an input box to enter password..


    thanks
    Last edited by Leith Ross; 05-08-2012 at 01:50 PM. Reason: Added Code Tags

  2. #2
    Registered User
    Join Date
    05-08-2012
    Location
    Tucson, US
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: how to unprotect sheet using - prompting user input

    Apprceiate any inputs..!!

    when I get the message "worksheet is protected", where the control goes? is it to worksheet_change??

  3. #3
    Registered User
    Join Date
    05-08-2012
    Location
    Tucson, US
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: how to unprotect sheet using - prompting user input

    how do i code to prompt input box for a password to unlock protected sheet?

  4. #4
    Registered User
    Join Date
    05-08-2012
    Location
    Tucson, US
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: how to unprotect sheet using - prompting user input

    is there a way try editing a cell pop up with input box saying worksheet protected, please enter password?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: how to unprotect sheet using - prompting user input

    Hello sathib ,

    An InputBox will not hide the password as it is typed. It is better to add a UserForm to your VBA project to handle the password entry and validation. The UserForm only needs two controls: A TextBox and a CommandButton. Once you have determined the cell changed was in either column "E" or column "J" you can call the UserForm. Here is the code for the Worksheet_Cjhange event and the UserForm code. All control names are the default names.

    Worksheet Change Event
    Please Login or Register  to view this content.

    UserForm Code
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  6. #6
    Registered User
    Join Date
    05-08-2012
    Location
    Tucson, US
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: how to unprotect sheet using - prompting user input

    Thank you very much Leith Ross for your solution. I already have worksheet_change sub in my code.
    I dont know how another worksheet_change will behave. I will give it a try..
    Last edited by sathib; 05-08-2012 at 09:35 PM.

  7. #7
    Registered User
    Join Date
    05-08-2012
    Location
    Tucson, US
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: how to unprotect sheet using - prompting user input

    Thank you very much Leith Ross for your solution.

    Unfortunately I could not resolve my issue.

    Here is what happened.
    1. I selected all sheet and format -> cells -> protection-> locked (uncheck)

    2. Selected my cells that I need a lock on it.. did the reverse of above process.

    3. Gone ahead and protected my sheet tools --> protect

    4. Copied your code.


    When I try to change my cell value that is locked, default message pops saying it is protected. My control does not goes to worksheet_change sub at all. .



    Anything I am missing here...!!

    thanks

+ 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