+ Reply to Thread
Results 1 to 8 of 8

Locking cell based on the validated list selection

  1. #1
    Registered User
    Join Date
    02-01-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    10

    Locking cell based on the validated list selection

    This might be really simple for you guys, but i am having no luck on my own. I have a validation list set for column Q. In the list i have 7 possible options. What i want is a VBA Code so that when option 7 is selected (eg. "Received") the cell in column Q with the word "Received" will be locked.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Locking cell based on the validated list selection

    Do you want all the cells containing "Received" in column Q to be locked or only the active cell where you select "Received"?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    02-01-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    10
    Quote Originally Posted by Mumps1 View Post
    Do you want all the cells containing "Received" in column Q to be locked or only the active cell where you select "Received"?
    Once "Received" is selected from the list the cell should lock so no further changes can be made.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Locking cell based on the validated list selection

    Start by unlocking the cells in column Q that will contain drop down lists and then protect the worksheet. Next, copy and paste this macro into the worksheet code module. Do the following: right click the tab for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make a selection in column Q.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-01-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Locking cell based on the validated list selection

    Mumps1,

    Thanks for your quick response. I have used the code but when i click on the list in column Q, its pops up window asking for the sheet password to unprotect. Can it work automatically locking the cell with out the pop up. Column Q id unlocked even though the sheet is password protected.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Locking cell based on the validated list selection

    In this code, change "mypassword" (two occurrences) to the password you are using.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-01-2013
    Location
    Trinidad
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Locking cell based on the validated list selection

    I replied earlier but seem it did not go. Where i am the internet quality is what it used to be when there was dial up. Anyway thanks for the support. One quick question again as your codes make me think of more scenarios. If i wanted to capture date when the word "shipped" is selected from the validation list in the cell next to the validation list and even when it change from “shipped” to “Received” the date will stay locked to when “shipped” was setected.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Locking cell based on the validated list selection

    I think that it would be much easier to follow if I could see how your data is organized. Perhaps you could post a copy of your file. Include a detailed explanation of what you would like to do using a few examples and referring to specific cells.

+ 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. Locking or Unlocking validated cells depending on the previous cell
    By biajw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2014, 11:36 AM
  2. Conditional Formatting a Row based on a data validated selection
    By Pope_003 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2014, 02:05 AM
  3. Multiple Selection from a data validated list in the same cell
    By JGDC2810 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-10-2013, 07:13 AM
  4. [SOLVED] Macro that runs data-validated cell individually through the list it is based on - Part2
    By dks345 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2013, 06:00 PM
  5. [SOLVED] Macro that will run data-validated cell individually through the list it is based on
    By dks345 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 07:46 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