+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting to Lock a Cell

  1. #1
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Conditional Formatting to Lock a Cell

    Can you use conditional formatting to decide to lock a cell?

    Something similiar to:
    (the following only pretends to be a photocopy of a formula, it is not a real formula, do not use near open flame or underwater)

    IF A1=ISBLANK ... Lock A1, IF A1=ISNOTBLANK ... Lock B1

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Conditional Formatting to Lock a Cell

    Not an option. If some calculation uses one or the other, and there's a priority (e.g., use A1 if not blank, else B1), then you can use CF in each to hide the unused value, making it pretty clear that it's being ignored.

    Otherwise, a trip to the VBA store.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Re: Conditional Formatting to Lock a Cell

    Thanks Shg, I was pretty sure that was the case.

    I don't like the VBA store. It's like the IRS trying to sell you a used car. A bunch of uber-technical stuff I don't understand with all the pressure of being told, this IS exactly what you want. So you drive it off the lot and a block later the tires all roll off. You go back, and they say, OH, well... you said shiny and comfy interior... you didn't say you wanted it to turn LEFT.

    But, I might have to learn it for this... I can't take the risk someone with minimal computer experience is going to accidently start erasing or writing over formulas and references to Important Things.

    Quote Originally Posted by shg View Post
    Not an option. If some calculation uses one or the other, and there's a priority (e.g., use A1 if not blank, else B1), then you can use CF in each to hide the unused value, making it pretty clear that it's being ignored.

    Otherwise, a trip to the VBA store.

  4. #4
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: Conditional Formatting to Lock a Cell

    protect cells with formulas and lock the sheet!

    if you auto protect a cell, what happens if someone puts in a wrong value, cell locks, it cant be changed, if it locks and you arnt there with the wrong value, sheet is useless anyway till you get back!!

    By default I protect all formulas and lock the sheet before I let it go live, so only editable cells are available to end users!

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting to Lock a Cell

    The only other option (outside of VBA) is Data Validation but that only works with manual entry (e.g. if someone pastes data in, then you lose)
    In A1 Text Length < 1
    In B1 with "Ignore Blank" unchecked
    Custom format =LEN(A1)=0
    Last edited by ChemistB; 04-29-2009 at 11:53 AM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Re: Conditional Formatting to Lock a Cell

    Squiggler,

    I am locking the sheet and they will only have a limited group of cells in which they can enter information... but SOMETIMES, they have to enter data in Column C but only if someone else did not enter information in Column B.

    I don't want them to enter in information into Column C if Column B already has information in it... and they will, even if they are told not to, unless I lock them out of it.

    VBA seems the best option here... and I'm halfway to a solution in that arena.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Conditional Formatting to Lock a Cell

    I don't like the VBA store. It's like the IRS trying to sell you a used car ...
    You sent me into a chuckling fit -- thank you
    VBA seems the best option here... and I'm halfway to a solution in that arena.
    Show us what you end up with. We'll see if we can add a free air conditioner ...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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