+ Reply to Thread
Results 1 to 15 of 15

Locked choices in dropdown cell and auto go to...

Hybrid View

Getalinks Locked choices in dropdown... 03-24-2010, 02:40 PM
6StringJazzer Re: Locked choices in... 03-24-2010, 03:15 PM
Getalinks Re: Locked choices in... 03-24-2010, 04:25 PM
contaminated Re: Locked choices in... 03-24-2010, 05:36 PM
6StringJazzer Re: Locked choices in... 03-24-2010, 05:36 PM
Getalinks Re: Locked choices in... 03-24-2010, 05:41 PM
contaminated Re: Locked choices in... 03-24-2010, 05:50 PM
Getalinks Re: Locked choices in... 03-24-2010, 06:01 PM
6StringJazzer Re: Locked choices in... 03-24-2010, 06:18 PM
Getalinks Re: Locked choices in... 03-25-2010, 09:14 AM
6StringJazzer Re: Locked choices in... 03-25-2010, 04:30 PM
6StringJazzer Re: Locked choices in... 03-25-2010, 04:35 PM
6StringJazzer Re: Locked choices in... 03-25-2010, 06:33 PM
JBeaucaire Re: Locked choices in... 03-25-2010, 06:42 PM
6StringJazzer Re: Locked choices in... 03-25-2010, 06:55 PM
  1. #1
    Registered User
    Join Date
    03-24-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Question Locked choices in dropdown cell and auto go to...

    Hi,

    I have 2 questions regarding a drop-down menu...

    1) Is there a way to make it when you type the first letter of a choice in the drop down, it cycles through to that choice instead of having to scroll each time?

    2) Is there a way to make a cell only allowed to have the data which are choices on the drop-down entered into that cell?

    Thank you in advance!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,758

    Re: Locked choices in dropdown cell and auto go to...

    Quote Originally Posted by Getalinks View Post
    I have 2 questions regarding a drop-down menu...
    By drop-down menu, I assume you mean a cell with data validation using a list. (Other way might be a combo-box control.)

    1) Is there a way to make it when you type the first letter of a choice in the drop down, it cycles through to that choice instead of having to scroll each time?
    Not built into Excel. It is possible to build something like that using VBA, but you would have to code all the details.

    2) Is there a way to make a cell only allowed to have the data which are choices on the drop-down entered into that cell?
    Yes. You set up the drop-down using Data Validation. Under "Allow:" select "List", then under "Source" enter the source of data that will be used for the list. Only blanks or data from the list will be allowed. (You can uncheck Ignore Blank if you don't want to allow blanks.)
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-24-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Locked choices in dropdown cell and auto go to...

    Would #1 be possible to just have the cell auto-complete as you type? That's what I really wanted anyway.

    Thank you for the answer to #2.

  4. #4
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Locked choices in dropdown cell and auto go to...

    Hi Getalinks
    Answering to your 1sr question. take a look at this file. Maybe it's not what u want, but it may give some idea....hth
    Attached Files Attached Files
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,758

    Re: Locked choices in dropdown cell and auto go to...

    Quote Originally Posted by Getalinks View Post
    Would #1 be possible to just have the cell auto-complete as you type? That's what I really wanted anyway.
    It's possible but I've never done exactly the same thing. You would create a combobox control instead of using data validation. You would associate the control with the same range on a worksheet that you used to create the data validation (you could also write VBA code to populate it). You configure the combobox MatchEntry property to have the behavior you want (default is to match against every character typed, that will give you your autocomplete). Then when the user completes the selection, you have to capture that result and put it where you need it. You have to figure out how to handle things like the user types in a character that doesn't match anything in the list.

    That's just a broad strategy. If you really want to pursue this provide some more details (sample workbook is always good) and I (or someone else here) might have time to write some code up for you.

  6. #6
    Registered User
    Join Date
    03-24-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Locked choices in dropdown cell and auto go to...

    contaminated: What am I looking at? I'm confused. I see what you did, I just don't know how you did it.

    6StringJazzer: You've now got me even MORE confused. Can you tell me that again in English?

  7. #7
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Locked choices in dropdown cell and auto go to...

    Say u have list of names sorted alfabetically.
    Press Ctrl+F3 and place this function in Refrers To field and name this function as DRange

    =OFFSET(INDIRECT(ADDRESS(MATCH(Sheet1!$F$2&"*",Sheet1!$B$4:$B$21,0)+ROW(Sheet1!$B$3),COLUMN(Sheet1!$B$4))),,,COUNTIF(Sheet1!$B$4:$B$21,Sheet1!$F$2&"*"))

    Then go to data validation and create dropdown as you usually do. Type =Drange in sourse field.

    In my example just press Ctrl+F3 to see named formulae.

  8. #8
    Registered User
    Join Date
    03-24-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Locked choices in dropdown cell and auto go to...

    I see where you are going with it and I like it. Is there a way to make it so the first letter you type is also in the drop-down field? I have no place to put the first letter field. I only can add the dropdown.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,758

    Re: Locked choices in dropdown cell and auto go to...

    This turned out to be WAY easier than I thought. See attached.

    This solution uses a combobox control. The combobox already supports the type-ahead feature. If you go to Design Mode, you can right-click on the combobox and select ListFillRange to set the list of data to populate the control. LinkedCell is where the result will go if you need it in a cell.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-24-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Locked choices in dropdown cell and auto go to...

    THAT is exactly what I want! Thank you so much!

    Now, for my 2 final questions regarding it...

    1) Can you change the font size in the box?

    2) Is there a way to make it so only the list choices are able to be entered in the box? (i.e. If someone enters "test" and there is no "test" choice in the choices it won't let them enter it.)

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,758

    Re: Locked choices in dropdown cell and auto go to...

    Quote Originally Posted by Getalinks View Post
    1) Can you change the font size in the box?
    Yes. I assume you are not familiar with these controls so I'll give you a little more detail than I did before.
    1. In Excel 2003, right click on an empty spot on your menu/toolbar space to get a list of toolbars, then check "Control Toolbox."
    2. From that toolbar, click on the leftmost icon that looks like a pencil, ruler, and triangle. That is the "Design Mode" button.
    3. Then right-click on the dropdown box (actually called a combobox). From that menu, select Properties. The properties will be listed in alphabetical order.
    4. Note the Font property. Click on the button to the right of the font name (has three dots in it), and you will get a box to format the font however you want--size, face, bold, etc. If you make the font larger, you will need to adjust the size of the combobox by dragging sides or corners, just like any other graphical object.
    5. The close the Properties box, and click on the Design Mode button again to exit design mode.
    2) Is there a way to make it so only the list choices are able to be entered in the box? (i.e. If someone enters "test" and there is no "test" choice in the choices it won't let them enter it.)
    There is a way documented but it does not seem to work for me. Following instructions as above, find the "Match Required" property and set it to TRUE. However, I find this has no effect in the sample workbook I posted.

    Quote Originally Posted by Excel Help
    If the MatchRequired property is True, the user cannot exit the ComboBox until the text entered matches an entry in the existing list. MatchRequired maintains the integrity of the list by requiring the user to select an existing entry.
    I am going to post a new thread specific to that issue.

  12. #12
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,758

    Re: Locked choices in dropdown cell and auto go to...


  13. #13
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,758

    Re: Locked choices in dropdown cell and auto go to...

    Thanks to JeanRage for referring me to another thread that answered this. The solution is that the Style property must be set to fmStyleDropdownList.

    However, note that the behavior will be slightly modified. The user will not see the letters he types. He will only see whatever name matches the letters he types. This is important because if he tries to type in a name that's not on the list, he won't see his own typing. He'll just see the closest fit, and to try another name he'll have to backspace. So the experience is a little counterintuitive.

    The alternative would be to include some VBA code to check the value when the user attempts to leave the box, and if the name isn't in the list, give a warning message and delete his entry so he can start again. I can help with that if that's the way you want to go.

  14. #14
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Locked choices in dropdown cell and auto go to...

    I now I'm late to the party here, and just for reference...here's a link to a file where I show a technique where I use double-data validation in a single cell. You can type the first letter and ENTER...then use the same cell again and shortened list appears starting with those letters.

    https://sites.google.com/a/madrocket...te-single-list
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  15. #15
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,758

    Re: Locked choices in dropdown cell and auto go to...

    This party never ends!

    Here's an example with a little code to back up the combo box. The code runs when the user changes cell selection on the worksheet. However, moving from a cell to the combobox then back to the same cell is not detected as a selection change.

    JBeaucaire's solution is more robust though possibly more difficult to implement. Consider all possibilities to see which one suits your situation best.
    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