+ Reply to Thread
Results 1 to 2 of 2

Cell equals value if worksheet is locked

  1. #1
    Registered User
    Join Date
    05-20-2009
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Cell equals value if worksheet is locked

    Hi Guys,

    was just wondering if there was a way to get a cell within a workpad of mine to equal a certain value, numbers or letters, if it is unlocked/locked?

    trying to protect it, so i want to set it up so that if its unlocked key cells values change rendering the spreadsheet useless

  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: Cell equals value if worksheet is locked

    To do this wouldn't be THAT hard to circumvent, but you can still give it a try.

    The trick is to put a UDF in your sheet that check for sheet protect status. Here's a UDF that does that:
    Please Login or Register  to view this content.
    That goes into a standard module.

    Next, in a cell somewhere way off and hidden somewhere, enter this formula:
    =ProtectedCheck()

    You'll get a TRUE/FALSE answer.

    Now NAME that cell "Key" so it's location is hard to find, and hide the column it is in. We're trying to bury it.

    Lastly, all throughout your sheet wrap your existing formulas in parentheses and add a *Key to the end, or bury it within the formula in several places. All different ways you can find, add it into your formulas.

    Whenever the sheet is UNLOCKED, the Key switches to FALSE and now all your formulas are multiplying by zero...giving you zeros everywhere. You only get the original formula values when the sheet is locked.
    _________________
    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!)

+ 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