+ Reply to Thread
Results 1 to 6 of 6

Lock specific cells once a value is entered with a drop down list

  1. #1
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Lock specific cells once a value is entered with a drop down list

    Hi,

    I have a spreadsheet that is being used to book leave. There are certain cells on the worksheet that are open to the user e.g. Name, Contract type etc. Further down is the area where they request leave. So in column B is the date from (where they have to enter the date in a certain format and column C/D (these are merged due to formatting of the worksheet) contains the date to etc. At the end in column AP there is a column for the manager to make their decision (this is protected from the user like most of the other cells.

    What I need is once the manager has made a decision i.e. they have selected either "Accepted", "Rejected" or "Cancelled" from the drop down and protected the workbook again the row where the decision has been made is locked. Or more specifically the cells that the person could once amend e.g. with the dates etc, is no longer editable. This will hopefully prevent someone from changing the dates after they have had it approved.

    I have looked on various forums/web sites but cannot find the specific code for my purpose and I did wonder if the merged cells (as mentioned above) were causing part of the issue?! Any help is greatly appreciated!

    Thanks
    D

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Lock specific cells once a value is entered with a drop down list

    Hi,

    A Sheet Change event macro that detects an entry in the Manager's AP column and which then unprotects the sheet, locks all the cells on that row and then resets worksheet protection.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Lock specific cells once a value is entered with a drop down list

    Sorry but I am really new to coding and have no idea about to write the code for what you suggest. I understand the logic and have found some similar code on the web that I think does what you say but it didn't work.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Lock specific cells once a value is entered with a drop down list

    Hi,

    If you'd like to upload the workbook no doubt one of us could add the solution for you.

  5. #5
    Forum Contributor
    Join Date
    03-10-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2010
    Posts
    180

    Re: Lock specific cells once a value is entered with a drop down list

    Hi,

    How do I do that?

    Thanks
    D

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Lock specific cells once a value is entered with a drop down list


+ 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 cells based on response from another - give drop down list
    By DHFE in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-10-2014, 05:39 AM
  2. automatically lock cells when data is entered
    By superchew in forum Excel General
    Replies: 12
    Last Post: 05-20-2013, 02:46 AM
  3. Lock specific cells in row after timestamp entered into another cell in same row
    By sbowden in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2013, 07:21 PM
  4. Replies: 3
    Last Post: 10-22-2012, 09:00 AM
  5. Lock Range of Cells After Text is Entered
    By cshenold in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-17-2012, 01:21 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