+ Reply to Thread
Results 1 to 6 of 6

Help with locking a cell if another cell contains certain text

  1. #1
    Registered User
    Join Date
    03-10-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Help with locking a cell if another cell contains certain text

    Hi all,

    I have a sales pricing model and i need to lock access to a cell if another cell contains certain text.

    If C7 = "Existing Client" then F14 is editable
    If C7 = "Prospective Client" then F14 is not-editable

    Any help would be much appreciated!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,603

    Re: Help with locking a cell if another cell contains certain text

    One way:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-10-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Help with locking a cell if another cell contains certain text

    Thank you for that, but I can't seem to get it to work... I am a novice when it comes to macros so bear with me.

    Do I need to protect or unprotect the cell or worksheet when running this? Should I save and close before it starts working?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,603

    Re: Help with locking a cell if another cell contains certain text

    Right click on the tab which you want to protect and select View Code. Copy and paste the code into the code pane. Then switch back to Excel and test whether or not you can select the cell.

    Regards, TMS

  5. #5
    Registered User
    Join Date
    03-10-2014
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Help with locking a cell if another cell contains certain text

    Amazing! Thank so much!!!!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,603

    Re: Help with locking a cell if another cell contains certain text

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Cell Locking and Unlocking, Formatting based on value of another Cell in same Row
    By NiCKz_01 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2014, 09:25 PM
  2. [SOLVED] Deactivating or locking a cell if a number is in the cell next to it
    By Mugazambi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2013, 01:21 AM
  3. Excel VBA Code for locking/unlocking a cell based on the value of another cell
    By latourjim in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2013, 10:03 PM
  4. Locking in text formatting in a cell. Is this possible?
    By rossfuin in forum Excel General
    Replies: 1
    Last Post: 02-22-2012, 09:00 PM
  5. Pasting outside data into unlocked cell of protected sheet without the cell locking
    By DarthMinogue in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2011, 09:12 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