+ Reply to Thread
Results 1 to 17 of 17

Locking cell dependence of the color.

  1. #1
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Locking cell dependence of the color.

    Hi all.
    Fist post here and would need help from smarter then me, hence I register here.

    I need lock automatically cell when color has changed. Color depends on the value from another cell, the value is taken from dropdown list.
    I need the cell unlocked when is white and need locked when is oragneish, is this possible in VBA or just in conditional formatting?
    There could be more cells then one with same color but they are in same row.
    Last edited by DeeWuu; 12-15-2023 at 11:37 AM.

  2. #2
    Forum Contributor
    Join Date
    11-06-2021
    Location
    Tripoli
    MS-Off Ver
    Still using 2007 in 2023
    Posts
    289

    Re: Locking cell dependence of the color.

    please DeeWuu provide an excel file of what you need and you shall have direct assistance

  3. #3
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Re: Locking cell dependence of the color.

    Apologies, I shall done this earlier.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Locking cell dependence of the color.

    The attached edited version of your sample workbook will do what I understand you want to happen.
    Attached Files Attached Files
    Excel 365 user. To unblock a downloaded macro-enabled workbook, go to your "Downloads" folder > right click on the workbook name > click 'Properties' > check the 'Unblock' checkbox. You can now open the workbook.

  5. #5
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Re: Locking cell dependence of the color.

    Appreciate the answer, however it doesn't work as I would like.
    Basically when I chose different item in D7 for example :
    if in D7 I chose "fixture plate" then G7 is orange and lock as I like to be and F7 and I7 stays white and unlock which is perfect.
    But when in D7 I change value to "MTS chuck" G7 is white and lock but I want unlock( because is white color) and F7 and I7 is orange and unlock which I want them to be locked due to orange color.
    I hope my explanation is good enough for you to understand what I mean as its really difficult for me to put this on post.

    Orange color- locked
    white color - unlocked

  6. #6
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Locking cell dependence of the color.

    When I test it, the orange cells are locked and white cells are unlocked as you change D7.

    Did you enable macros on the downloaded workbook? It's a macro-enabled workbook so you need to allow macros to run. You should see a yellow bar with 'Enable content' button displayed under the ribbon when you open the workbook- click that button.

    You might also need to unblock the workbook
    - for instructions how to do this, see my signature under this post.

  7. #7
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Re: Locking cell dependence of the color.

    WOW i fallowed your instruction and it's working on that workbook but i can't managed to put on workbook i really want as there are many codes already and they don't like each other...
    So could you please look on new workbook I attached and please give me idea where to put them without breaking old codes as they I need them for something else.
    Please look at the are wit thick black border. Thanks for your time
    Last edited by DeeWuu; 12-15-2023 at 10:06 AM.

  8. #8
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Locking cell dependence of the color.

    In the Workbook_Open event procedure of the uploaded workbook, the code refers to a sheet called Archive which has some data and filters on it. However, that worksheet isn't included in the up;loaded workbook.

    If you want someone to examine the code and find debugging errors, you'd need to upload as full a workbook as possible, removing confidential details (make up names of people etc).
    Otherwise, it's too messy trying to compensate for omissions that trigger errors when opening and using the workbook.

  9. #9
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Re: Locking cell dependence of the color.

    hopefully now be OK. My file its to big to upload, will try to shirk it and then.

  10. #10
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Locking cell dependence of the color.

    There is no workbook available to download now?

  11. #11
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Re: Locking cell dependence of the color.

    Unfortunatelly im no able to shirk workbook unless I delete archive sheet and two different ones....
    If you can'T do it its fine I understand, no worries, you helped me any way
    Attached Files Attached Files

  12. #12
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Locking cell dependence of the color.

    Could you give precise sheets and cell addresses that you want to have the desired code attached to- I can't find them

    EDIT- I think it's change cell F17 and enable/disable cells G17, I17 and J17.

    The way the attached is setup is if a cell (G17/I17/J17) is orange, it's locked. If it's white, it's unlocked. Your conditional formatting sets the cell's colour so once the conditional formatting is correct, those cells will be locked/unlocked whenever you change cell F17.

    If this solves your issue, mark the thread as SOLVED at the top of your first post.
    Attached Files Attached Files
    Last edited by deadlyduck; 12-15-2023 at 10:43 AM. Reason: Found cells

  13. #13
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Re: Locking cell dependence of the color.

    Ok, so if :
    IN cell E17 is "N" the cell in thick black boarders become orange and needs to be locked but unlocked when they are white, they become white when in E17 is Y
    Basically cells in black thick border need to be locked when orange and unblocked when white, when the value change in E17 and/or F17
    Attached Files Attached Files

  14. #14
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Locking cell dependence of the color.

    I think this is now working
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Re: Locking cell dependence of the color.

    Almost there, its closer then further from solving this, thanks a lot for your time and help.

  16. #16
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Locking cell dependence of the color.

    I added a check for protection of sheet4- that might have been an issue when first opening and trying to change cell E17 or F17.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    12-14-2023
    Location
    Worthing
    MS-Off Ver
    365
    Posts
    9

    Re: Locking cell dependence of the color.

    It all working now how I wanted! Thank you so much for you time and help! You are legend.

+ 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] "Locking" a Cell Fill Color
    By JFactor in forum Excel General
    Replies: 9
    Last Post: 11-25-2018, 10:16 AM
  2. [SOLVED] Sum uniquevalues in dependence to another column
    By JasXel in forum Excel General
    Replies: 21
    Last Post: 11-28-2017, 09:31 AM
  3. [SOLVED] Cell value change dependence on another cell value
    By rajeshn_in in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2016, 02:51 AM
  4. Cell dependence?
    By hristij4n in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2010, 09:28 AM
  5. Time Dependence
    By jhelliar in forum Excel General
    Replies: 2
    Last Post: 01-22-2009, 05:27 PM
  6. making y(x) dependence
    By szk in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 09-30-2008, 03:34 AM
  7. Data Validation Dependence
    By kowell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-20-2007, 02:52 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