Consulting

Results 1 to 3 of 3

Thread: locked cells

  1. #1
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location

    locked cells

    Hi, i have a worksheet that I need most cells protected. However i want ability to unlock a range of cells with a password prompt but not unprotect the whole work sheet incase they delete some formulas.
    Is there a way to change status of a range of cells from locked to unlocked with a password but still keep the sheet protected? Then reverse it?

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Yes. While one could use an Inputbox to get password, a textbox has a passwordchar property to hide it.

    If you need an example, see the attachment. Since I did not know what range you meant, I used the Selection range. If you have a set range that you don't want protected even with the macro, then it will need modification. One can iterate the selected cells and only change the locked status for cells without formulas.
    Attached Files Attached Files

  3. #3
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location
    Thanks Kennith. Your example works for me.

Posting Permissions

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