+ Reply to Thread
Results 1 to 4 of 4

Lock and Unlock an entire row based on a condition

  1. #1
    Registered User
    Join Date
    01-27-2020
    Location
    NZ
    MS-Off Ver
    2013
    Posts
    2

    Lock and Unlock an entire row based on a condition

    Hi, am looking for a macro to lock cells of an entire row when another cell has meet a certain condition. I have only basic VBA experience. See attached Spreadsheet with my example.

    Basically a user enters data into rows A3 to G3, and when done selects "Completed" in the drop down list in H3. This should then lock all cells to the left of H3 e.g. when the user selects "Completed" in cell H3 all the cells (A3 to G3) to the left of it should be locked. Then the user moves onto the next row (A4) to enter data there. If the user makes a mistake, they will need a password to unlock the locked-row to make changes, so maybe a prompt when they select "Completed" that tells the user that they won't be able to make changes if they choose "Completed". If column H3 to H infinite "Is Blank" or "Not Completed" is selected, then the user can edit the rows before it.
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Lock and Unlock an entire row based on a condition

    Hi dtr9000

    Welcome to the Forum!!!

    Try this Code in the attached. Password is set as "password". You'll need to set it as you desire in two places as indicated...
    This Workbook Code..
    Please Login or Register  to view this content.
    Worksheet Change Code...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    01-27-2020
    Location
    NZ
    MS-Off Ver
    2013
    Posts
    2

    Re: Lock and Unlock an entire row based on a condition

    Thanks jaslake

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Lock and Unlock an entire row based on a condition

    You are welcome dtr9000...thank you for the Rep Points...
    John

+ 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 unlock cell depending condition
    By IGORRRRR in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-29-2020, 02:32 PM
  2. Lock and unlock cells based on value
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2016, 04:53 AM
  3. [SOLVED] lock entire row with a value in cell & unlock it after a password &value in cell is given
    By ajish002 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-21-2014, 12:28 PM
  4. Lock/Unlock cells based on value in another cell
    By 13gentj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2014, 11:00 PM
  5. Lock/Unlock Macro for Entire Row linked to Color-Changing Shape
    By sumkynduvstrange in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-26-2013, 10:27 AM
  6. Unlock / Lock cell based on another cel value
    By BernardTodd in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-13-2013, 10:38 AM
  7. How to lock and unlock a range of cells based on certain cell's value?
    By potato in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-25-2012, 04:34 AM

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