+ Reply to Thread
Results 1 to 6 of 6

Only lock a cell if..

  1. #1
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Only lock a cell if..

    Is it possible to only lock a cell if a certain cell is yes?
    For example I only want to be able to edit cell A1 in case cell A2 is "yes"
    In case of no I want cell A1 to be locked.

    I know how to lock a cell but I do not know how to combine it with an if situation.

    Hope somebody can help me!

    Thanks!
    Last edited by keis386; 06-18-2015 at 10:18 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Only lock a cell if..

    You can use Data Validation for this. On cell A1 open the DATA > VALIDATION and use the settings:

    Allow: Custom
    Source: =A2="Yes"

    On the ALERT TAB you can set a helpful message.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    01-17-2011
    Location
    amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    189

    Re: Only lock a cell if..

    Thanks! Is it also possible to only insert numbers?

  4. #4
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Only lock a cell if..

    Seems you want Source: =AND(ISNUMBER(A1),A2="No")

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Only lock a cell if..

    Actually:

    =AND(ISNUMBER(A1),A2="Yes")

  6. #6
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Only lock a cell if..

    Yeah, that!

+ 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. lock and insert formula in a cell based on selection of text in another cell
    By alirazafazal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2014, 06:08 AM
  2. Lock/Unlock a cell based on the value selected from drop down in adjacent cell
    By mahesnrm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2013, 08:28 AM
  3. Replies: 1
    Last Post: 03-11-2013, 03:10 PM
  4. Replies: 1
    Last Post: 03-10-2013, 01:54 PM
  5. Replies: 2
    Last Post: 02-22-2012, 10:10 AM

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