+ Reply to Thread
Results 1 to 2 of 2

If cells D4:D53 Is Not Null then lock. Else leave unlocked.

  1. #1
    Registered User
    Join Date
    05-19-2016
    Location
    Bolton
    MS-Off Ver
    2010
    Posts
    4

    If cells D4:D53 Is Not Null then lock. Else leave unlocked.

    Hi,

    I have a column A. The data in this column is auto populated from an If statement.

    The issue is after a few minutes the data can change, which changes the data in the cell.

    I need to lock the cell as soon as the cell has changed from empty to a value. The cells change from Null to having a value at a rate of about 1 every 10 mins.
    So like D4 will get a value then 10 minutes later D5 will get a value, I need the cell to keep the first value it gets.

    Please note the value is not manually entered but comes from and If statment.

    basically i need:

    If cells D4:D53 IsNotNull then lock. Else leave unlocked.

    I have been researching for hours and tried many different solutions but can not get anything to work. Please help.

    Any help is greatly appreciated.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: If cells D4:D53 Is Not Null then lock. Else leave unlocked.

    Implementing code to lock the cell is not hard but from your description I am not sure that is what you want.

    Locking a cell prevents anyone from entering anything in the cell if Protection is turned on. It will not prevent it from updating the result of a formula when other data changes, such as an IF like you describe.

    If you want to "freeze" the result of a formula, you must convert the formula to a value. That can also be done in code. Once you freeze the value, would you ever want to return it to the original formula?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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] Why does this macro lock unlocked merge cells?
    By resultsman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-04-2014, 01:07 AM
  2. Replies: 5
    Last Post: 07-15-2013, 03:57 AM
  3. [SOLVED] How to lock previously unlocked cells on a protected worksheet
    By susuyesyes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-07-2012, 10:28 AM
  4. Lock cells with data; keep blank cells unlocked
    By kchen in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-28-2010, 01:36 AM
  5. how to leave some cells unlocked in protected sheet
    By shatzia in forum Excel General
    Replies: 0
    Last Post: 09-22-2010, 01:29 PM
  6. [SOLVED] lock only formula cells without protecting sheet - leave open
    By BLANK JUNK MAIL RECEIVED - CREATE RULE in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-11-2006, 11:00 PM
  7. Replies: 1
    Last Post: 08-18-2005, 11:05 AM

Tags for this Thread

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