+ Reply to Thread
Results 1 to 6 of 6

Autolock Cells from a Drop Down List Selection and a Calendar Selection

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    Texas, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Autolock Cells from a Drop Down List Selection and a Calendar Selection

    I need to know how to do the following in the attached spreadsheet. This is a large post, but I haven't been able to get the information I need so I wanted to be as clear as possible. When you respond, please be absolutely clear as to what to do such that somone who has never used Excel before could do it. I need to know how to do these for version 2003 at work, and for version 2010 at home.

    1. In column A, cells A2 through A60 each contain a drop down list that has 9 options: AAA, BBB, CCC, DDD, EEE, FFF, GGG, HHH, and III. I need an individual cell in A2 to A60 to be locked once any one of the 9 options is selected, and the entry cannot be changed without a password. For example, if AAA is selected in A2, A2 alone cannot be changed but A3 through A60 remain unlocked until one of the 9 options is selected in each of those cells.

    2. In column B, I need two conditions:
    Condition One, I need it such that when any cell from B2 through B60 is single-left clicked from a mouse, a calendar appears that enables to user to select a date. Once that date is selected, the date will appear ONLY in the corresponding cell AND ONCE THE DATE IS SELECTED FROM THE CALENDAR, THE CALENDAR WILL DISAPPEAR. For example, if cell B2 is single-left clicked, a calendar will appear. Once a date is selected from the calendar, the selected date will appear in B2 and the calendar will disappear. Then the same action can be done to each remaining unlocked cell from B3 through B60.
    Condition Two, once a date appears in a cell from B2 through B60, the cell is locked and the entry cannot be changed without a password.

    3. In column C, I need the same conditions for cells C2 through C60 that were applied above to A2 through A60. As you can see, the 9 option selection (AAA through III) is already programmed for C2 through C60 as well.

    4. In columns D and E, I need the same conditions for cells D2 through D60 and E2 through E60 that were applied above to B2 through B60.
    Attached Files Attached Files

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

    Re: Autolock Cells from a Drop Down List Selection and a Calendar Selection

    Hi John. Please try the attached file. I cannot take credit for the calendar pop-up. I found it after doing a search but I can't remember where. I cannot guarantee that everything will work with Excel 2003 but it should work with 2010. You'll have to try it on both versions. Please make sure that macros are enabled before you try it. I have protected the sheet with the word "password". Please change it to one of your choosing and then replace "password" with the one you choose in the macros. Do the following:
    • Unprotect the sheet and enter "password" without the quotes when prompted.
    • Protect the sheet again and use a password of your choosing (you'll be prompted twice to confirm the password).
    • Hold down the ALT key and press the F11 key to bring up the Visual Basic Editor.
    • On the left hand side, right click the sheet that contains your data and then click 'View Code'.
    • Replace each occurrence of "password" with your password - include the quotes.
    • Close the VB window or press ALT-F11 to return to the spreadsheet.
    • Re-save the file.
    If anyone wants to change the data after it has been entered, you will have to unprotect the sheet with your password, makes the changes and then protect the sheet again with the same password. If you ever change the password, you will have to make the appropriate changes in the code as described above. Please let me know how it works out.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-31-2013
    Location
    Texas, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Autolock Cells from a Drop Down List Selection and a Calendar Selection

    Mumps, it works perfectly! I love how it goes to the column immediately to the right after data is entered, and then returns to the next row back to the far left! There is an exclamation point appearing on the file icon. Do you know what that means? Also, it turns out that my supervisor already had a template for how they wanted the data organized. I tried modifying the code to apply to her template, but I keep getting error messages. Would you be able to apply the code to the attached document? I would need the calendar prompts in A13 through A99, D13 through D99, and F13 through F99. Thank you so much for your help!
    Attached Files Attached Files

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

    Re: Autolock Cells from a Drop Down List Selection and a Calendar Selection

    Hi John. I'm glad you liked it. I have to go out now but I'll look at your attachment in the morning.

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

    Re: Autolock Cells from a Drop Down List Selection and a Calendar Selection

    Hi John. See if the attachment does what you were looking for.
    Attached Files Attached Files

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

    Re: Autolock Cells from a Drop Down List Selection and a Calendar Selection

    My apologies, John. Please use this attachment. I found a couple of locking issues in the previous one. If you notice any problems, please let me know.
    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)

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