+ Reply to Thread
Results 1 to 5 of 5

protect or unprotect a locked cell with formula

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    Taunton, Somerset, UK
    MS-Off Ver
    Excel 2007
    Posts
    85

    protect or unprotect a locked cell with formula

    Hi Beautiful people of the Excel World.

    So, I am hoping this is possible - I need a formula or something that will give a cell protection or unprotection based on what is in another cell.
    For example, I have products of which some can allow for custom sizes, and some that cannot, so if the user enters the product code for an item in Cell B13, cell S13 will return a lookup result that states if that item will allow for special sizes. Cell H13 needs to be the cell in which the user can add the custom size if the item allows for it, so needs to unprotect itself based on the result in cell S13.

    Another point to note, is that the worksheet is locked so users cannot mess with it.

    Hoping it's possible, and that someone can help...
    =IF(Richard="Gets Help",Richard=,Richard=Keh?)

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,080

    Re: protect or unprotect a locked cell with formula

    This could be done with Data Validation using a custom formula, although it is not protection or unprotection (that is why we ask members to describe the problem, not the solution).

    What does S13 look like? Let's suppose it is Yes for allowing custom sizes, and No for not allowing them. Then H13 would have a Data Validation formula that says

    =S13="Yes"

    If S13 is not Yes, then Data Validation will not allow any entry to H13 and will show the user an error message. You can tailor this message when setting up the data validation.

    If you need more detailed help with this, please attach your file. Under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,749

    Re: protect or unprotect a locked cell with formula

    You might be able to do it with Data Validation. Otherwise, you'd probably need VBA.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    02-08-2013
    Location
    Taunton, Somerset, UK
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: protect or unprotect a locked cell with formula

    Quote Originally Posted by 6StringJazzer View Post
    This could be done with Data Validation using a custom formula, although it is not protection or unprotection (that is why we ask members to describe the problem, not the solution).

    What does S13 look like? Let's suppose it is Yes for allowing custom sizes, and No for not allowing them. Then H13 would have a Data Validation formula that says

    =S13="Yes"

    If S13 is not Yes, then Data Validation will not allow any entry to H13 and will show the user an error message. You can tailor this message when setting up the data validation.

    If you need more detailed help with this, please attach your file. Under the text box where you type your reply click the Go Advanced button. On the next screen scroll down and click on Manage Attachments, which will show a pop-up window to Select and Upload a file. Then close the window.
    Hi.

    Thanks for your response.
    Okay, so to be more clear:

    The user adds a product code to unprotected cell B13,
    Protected Cell C13 shows the products description from VLOOKUP,
    Cell S13 is hidden, and does not form part of the visible sheet, but returns a result of either 'YES' or 'NO', determining if the item allows custom sizes or not,
    Cell H13 should be locked UNLESS cell S13 result='YES', which will then allow the user to enter their own specified dimensions into cell H13 if that item allows it. (Eg, standard might be 600, and the user can then add their own, eg 647 or 732 etc) The user needs to be able to add whatever number they so desire, so a pre-defined DV list to select from would not work.

    Hope this helps.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: protect or unprotect a locked cell with formula

    Data Validation will probably do all that for you. Did you play around with it at all yet?

    Also, it would probably help if you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] unprotect / re-protect cell with double click
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-01-2017, 02:55 PM
  2. Protect/unprotect formula cells of entire workbook
    By shafiqe in forum Excel General
    Replies: 5
    Last Post: 07-14-2013, 01:59 AM
  3. [SOLVED] Macro to temporarily unprotect sheet to apply filter to locked cell range, then reprotect?
    By lsargent in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2013, 10:27 AM
  4. Locked cell won't protect
    By simonfree in forum Excel General
    Replies: 3
    Last Post: 11-17-2009, 05:15 AM
  5. Cell range protect/unprotect toggle
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2008, 07:37 AM
  6. Unselect locked cells when protect/unprotect worksheet
    By eight8 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-08-2007, 03:00 AM
  7. Temporarily unprotect cell then protect afterwards
    By Reggie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-20-2005, 05:45 PM

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