+ Reply to Thread
Results 1 to 13 of 13

Disable cells when another cell is true

  1. #1
    Registered User
    Join Date
    12-13-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    68

    Disable cells when another cell is true

    Hi all,

    I would like to format the blue rectangle C2:C5 so that only one cell can accept "yes", and when it is inputted " yes" in one cell others cells to be disabled. I attach an example file.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-13-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Disable cells when another cell is true

    If it is possible without VBA :-)

  3. #3
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Disable cells when another cell is true

    If you put this into your data validation, you will see Yes if no other cells in column C already contain Yes.

    =IF(COUNTIF(C:C,"Yes")=0,$G$2,INDIRECT("NoList"))

    The second part just puts a "dummy" list in so that the drop down list appears as blank.
    Excel is a constant learning process and it's great to help each other. If any of us have helped you today, a click on the "reputation" star on the left is appreciated.

  4. #4
    Registered User
    Join Date
    12-13-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Disable cells when another cell is true

    It works but I would like the customer can change its choose because if he wrongly entered "yes" to "501-1000" to have the possibility to correct let say to "up to 500"

  5. #5
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Disable cells when another cell is true

    If I understand you correctly, you want the customer to be able to choose Yes in another cell, which would then blank out the cell in which they previously chose Yes?

    I think this would only be possible with VBA as the validation is checking the active cell and making a decision on whether to allow an entry or not. Validation can't change the values in other cells in the range. Would you like me to create the VBA or will you leave it that the user will need to delete one Yes before they can enter another?

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: Disable cells when another cell is true

    If you disable the cells with selection of "Yes", how do you enable them if a correction is required? and surely this defeats the objective of your first requirement ?

  7. #7
    Registered User
    Join Date
    12-13-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Disable cells when another cell is true

    Yes, the objective is to make the same effect as option (radio) buttons but without VBA. Do you think it is possible?

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: Disable cells when another cell is true

    See attached using radio buttons; could this be used?
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    01-08-2011
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2007 to 2016
    Posts
    456

    Re: Disable cells when another cell is true

    You can only do this with VBA. If you want to use this method, copy this code to Sheet1 in your workbook (Press Alt-F11 to get to the editor)

    Please Login or Register  to view this content.
    You will also need to change your data validation back to just the =$G$2 list value and save your workbook as an xlsm file

  10. #10
    Registered User
    Join Date
    12-13-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Disable cells when another cell is true

    With radio buttons is OK, but how can I make the link between option chosen and let say points assigned (like in the attached)
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: Disable cells when another cell is true

    Try

    =INDEX($D$2:$D$5,F2)

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,147

    Re: Disable cells when another cell is true

    See attached: ensure radio buttons are in sequence.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    12-13-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: Disable cells when another cell is true

    Thanks all.

+ 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. Replies: 6
    Last Post: 03-26-2016, 05:49 PM
  2. VBA to check cell value and enable/disable two other cells in same row
    By dexterz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2015, 09:09 AM
  3. enable and disable cells based on the value of another cell
    By Emma_B in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-09-2013, 08:06 AM
  4. [SOLVED] disable input to cells when a cell has a specified value
    By dxcheung in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-19-2013, 08:39 AM
  5. Disable cells based on previous cell's value
    By ddabney in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-06-2013, 01:12 PM
  6. Disable Cells except for the selected cell
    By sanjeevkumarmc in forum Excel General
    Replies: 2
    Last Post: 10-15-2012, 10:16 AM
  7. [SOLVED] Disable Cells based on Cell Selection
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-03-2012, 12:21 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