+ Reply to Thread
Results 1 to 4 of 4

Lock/Unlock cells based on value in another cell

  1. #1
    Registered User
    Join Date
    12-14-2014
    Location
    Michigan
    MS-Off Ver
    2013
    Posts
    12

    Lock/Unlock cells based on value in another cell

    Hey guys,

    I'm sorry for creating this thread because I know that this question has been asked so often. I'm pretty new to excel, let alone Visual Basic. I just got promoted to supervisor of an organization that deals with a lot of data entry and I'm just looking for ways to reduce human error, increase speed, etc.

    For this specific situation I have a sheet similar to the one below with the data entry fields visible unlocked. there are like 500 fields down the whole sheet but I'm primarily concerned with just the first one and I can figure out doing the rest later.

    As seen in the document I uploaded I have fields for the group number, code, whether or not it was called in, etc.. The thing is that not all these entry points are required for all the codes that my organization uses. What I want is for all the entry point cells to be unlocked until the code BC or LC is used. Then I would like the cells for Called, E-Number, and number in party to be locked. But then when the code is changed to 1015 or left blank, for the cells to again be unlocked. I know that I'll have to use An If-Then statement. I've tried copying other people's codes who are attempting to do the same thing and just change the cell numbers to meet my needs but I can't seem to get it right. Could you guys help me out by writing a code for me? Try to keep it somewhat simple so I can make small changes if any problems arise.

    I will really appreciate any help. It has been somewhat stressful and time consuming, trying to figure this out.
    Attached Files Attached Files
    Last edited by 13gentj; 12-15-2014 at 01:34 PM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Lock/Unlock cells based on value in another cell

    I don't see any attached workbook. Can you do it again?
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    12-14-2014
    Location
    Michigan
    MS-Off Ver
    2013
    Posts
    12

    Re: Lock/Unlock cells based on value in another cell

    Oh, Sorry. I just added the attachment. Thanks for pointing that out.
    Attached Files Attached Files

  4. #4
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Lock/Unlock cells based on value in another cell

    Look at the attached workbook.
    You can try it. By default, the sheet is protected and the password is Password
    The blue cells are usually not locked so you can change them. But if you enter BC or LC in the code cell, then you'll have 3 locked cells in F4, J4 and K4.

    In a module, I left 2 macros for you to use or not. One is to protect the sheet and the other one to unprotect it. I find it handy to have those available but you might not want to leave them in your final workbook though.

    Hopes this helps
    Attached Files Attached Files

+ 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 and unlock cells based on value
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2016, 04:53 AM
  2. Lock/unlock specific cells in a row based on another cell content of the same row
    By st_rod000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2014, 02:58 AM
  3. lock/unlock cell based on another cells input
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-21-2013, 03:17 PM
  4. Lock and unlock a cell or two cells based on a value of another cell
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2013, 07:34 PM
  5. 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