+ Reply to Thread
Results 1 to 2 of 2

lock row when specific cells have data added.

  1. #1
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    lock row when specific cells have data added.

    Morning happy campers.

    My spreadsheet goes from Column A over to S,
    I am looking for some code that will do the following:

    Lock all rows containing data to prevent editing / changes , (where data is present in Column K1, 2, 3, 4, 5, 6 & 7 for example, lock rows 1-7)
    *based on the following criteria
    When a user saves and/or closes the sheet.

    BUT - i would like to be able to easily modify the code, lets say that today my requirement is to lock the rows based on column K containing data, but next week it may be a different column, B for example.

    I already have some code i can modify to allow the protection to be removed based on the user ID in windows, but am struggling to make the above work.

    I did have some code before that would lock cells based on the cell 'Changing' but i found that even double clicking in the cell would cause it to lock, so i would need this one to look at the cell being blank or not instead of the 'change' being the trigger.

    Many thanks in advance

    Galvinpaddy
    Last edited by galvinpaddy; 10-22-2013 at 04:26 AM. Reason: subbed

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: lock row when specific cells have data added.

    Hi Galvin,

    I did have some code before that would lock cells based on the cell 'Changing' but i found that even double clicking in the cell would cause it to lock, so i would need this one to look at the cell being blank or not instead of the 'change' being the trigger.
    I still think this would be the best way to go, just check if the cell is empty.
    Do like this :

    Please Login or Register  to view this content.
    Please click the * below if this helps
    Please click the * below if this helps

+ 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. Lock specific cells
    By PerdixDaedalus in forum Excel General
    Replies: 2
    Last Post: 01-12-2013, 10:44 AM
  2. [SOLVED] Lock All Cells after data entry of a specific cell
    By celialynn in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-09-2012, 01:41 AM
  3. Replies: 3
    Last Post: 10-22-2012, 09:00 AM
  4. Replies: 4
    Last Post: 05-04-2010, 02:25 PM
  5. Can't lock specific cells.
    By manoa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-18-2007, 12:37 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