+ Reply to Thread
Results 1 to 2 of 2

Skip lock based on cell value

  1. #1
    Registered User
    Join Date
    10-06-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    20

    Question Skip lock based on cell value

    Hi,

    I've sourced a code online for locking cells based on value but it seems to lock the cells above that aren't equal to the value.

    I combined it with my code to essentially add the date to column L and then lock the cell in column K to prevent someone from editing it and the sequence running again and overriding the value in column L.

    Please Login or Register  to view this content.
    Any help understanding why it is locking cells above it if they are filled with any value will be much appreciated. Equally, any help simplifying the code would also be appreciated.

    ty

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Skip lock based on cell value

    The core of your problem is in this line:
    Please Login or Register  to view this content.
    RangeToLock = K8:K1000 and SpecialCells(2) looks at cells with literal data.
    This means that all cells in the range K8:K1000 having literal data will be locked.

    Actually the only piece of code you need is this (I think):
    Please Login or Register  to view this content.
    Last edited by Tsjallie; 11-05-2016 at 03:22 PM.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

+ 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] Lock & skip columns
    By I.am.Rustam in forum Excel General
    Replies: 2
    Last Post: 06-20-2016, 10:34 AM
  2. Skip Cells based on colour of cell
    By Cremorneguy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-01-2014, 10:16 PM
  3. How to lock cell based on first value?
    By bensaps10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2014, 09:33 AM
  4. Lock/Unlock a cell based on the value selected from drop down in adjacent cell
    By mahesnrm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2013, 08:28 AM
  5. Lock row based on cell value in same row
    By Eline in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-11-2013, 09:56 AM
  6. [SOLVED] Skip calculation based on other cell value in a macro
    By avarax in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2013, 01:18 PM
  7. Help in an iterative macro to copy/skip row based on cell value
    By rhiminee in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-13-2012, 03:08 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