+ Reply to Thread
Results 1 to 6 of 6

Locking cells depending on what is entered in another cell

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Locking cells depending on what is entered in another cell

    Hi,

    I'd like to lock some cells depending on what is put in a particular cell.

    As shown by the file attached, if the first column (Amendments) has a "no" in A4, I'd like to lock out cells B4:D4. (The sheet will be protected). If it's a "yes" then the cells are unlocked.

    I'd like to then apply this to all subsequent rows (i.e. lock B5:D5 if a "no" in A5 etc.)

    Can anyone help?

    Have attached a sample file.

    Nujwaan
    Attached Files Attached Files
    Last edited by nujwaan; 09-23-2009 at 08:39 AM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Locking cells depending on what is entered in another cell

    Place this code in the module of the worksheet and adust range reference as needed.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Locking cells depending on what is entered in another cell

    Below is a slight variation which will make use of a Password constant and unprotect/protect the sheet object itself as part of this routine (else locking the cells has no effect):

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Locking cells depending on what is entered in another cell

    Hey Donkeyote thanks for that.

    The thing is how do i make it so the cell is ONLY unlocked when the column before says Approved rather than the 'IS Nothing...' bit you've written?

    Regards,
    Nujwaan

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Locking cells depending on what is entered in another cell

    nujwaan,

    Is this the same question you're asking in http://www.excelforum.com/excel-prog...ith-macro.html ?
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    09-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Locking cells depending on what is entered in another cell

    hey it i shg...

    sorry about that - thought it hadn't posted.

    Thanks. will close both if ur solution works

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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