+ Reply to Thread
Results 1 to 13 of 13

Dropdown box suggested list option by typing the first letter of an option

  1. #1
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Dropdown box suggested list option by typing the first letter of an option

    I don't think I am explaining my issue correctly in the title, or I think it will be confusing if I did.

    I have a dropdown box (data validation) with many options to select from. What I want to know is that if it's possible to have the dropdown box give me suggested options after typing the first letter/first few letters. Pretty much like any search out there like google.

    Here's an example of what I mean just to clarify:

    My list in my drop down consists of: "Apple", "Apricot", "Banana", "Blueberry", "Kiwi", and "Plum"

    Now in the drop down, I type "A" it suggests that I want to select "Apple" or if I keep typing and type "Apr" it suggests I want to select "Apricot"

    Another example: In the drop down I type "P" it suggests that I want to select "Plum"

    Not sure if this is actually possible, but I figured i'd ask. I hope this explanation has been clear enough for others to understand.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Dropdown box suggested list option by typing the first letter of an option

    This works, only trouble is you need to Click "Enter" after you enter you first few letters in the validation cell , for the code to work.
    So if you type in "Pl" in "C1" then click "Enter" you Get "Plum"
    Alter validation cell (C1 in this Case) to suit.
    NB:- Copy code into sheet module.
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Dropdown box suggested list option by typing the first letter of an option

    Hey Mick, thanks for the response. Unfortunately, this is not working. I have changed C1 in the code to where my drop down is located (B10). I try typing the first two letters and press enter it gives me the data validation error where the value doesn't match the data validation restrictions defined for the cell. I press cancel, and then VBA wants to pop up and then excel crashes. Not sure if you can help, but this is whats happening.

  4. #4
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Dropdown box suggested list option by typing the first letter of an option

    To make this easier, my workbook is attached. The only focus is the drop down boxes B10-B450 in sheet "W2 Friday". Everything else is irrelevant.
    Attached Files Attached Files

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Dropdown box suggested list option by typing the first letter of an option

    Try this returned file:-
    NB:- The code now works quite well, but for some strange reason if you type "Wo" in any of the validation cells you get "Works Object" which is in "B9" but not in the validation lists. I don't know why !!!
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Dropdown box suggested list option by typing the first letter of an option

    Unfortunately, I did find more issues with it as well that will affect the point of the spreadsheet :/ otherwise it wouldn't have been a big deal. Whenever the code does it's work, I delete what was entered and it auto-populates to the list selection "IGO - Paper" for some odd reason and it counts it with the rest of the calculations within the spreadsheet. I have 60+ others that will be using this spreadsheet once completed, otherwise I just wouldn't delete anything and that's an easy solution.

    Also, the code seems like it wants to grab from anything in column B. Which is very weird considering the range is clearly stated in the code to grab from only B10-B450 so I understand why you can't figure it out either. So weird.

    If you can't get it figured out then no worries, it's not a big deal at all. Just wanted to see if I could add it in for it to be more user friendly.
    Last edited by jennis7242; 08-13-2017 at 09:35 PM.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,538

    Re: Dropdown box suggested list option by typing the first letter of an option

    How about the attached.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Dropdown box suggested list option by typing the first letter of an option

    Thank you so much! That works fantastic. Is there anything else you did besides add the code to VBA? I just finished my project without the "searchable" drop downs. I opened it back up and added the code to each sheet (this now has many sheets) and it doesn't work with this new file. I even tried it with one sheet and it still doesn't work on my final file.

    If it's something simple then please let me know. If not, then don't worry about it. You've done enough, I'll just redo it all with the file you've sent me. Attached is the finale file if you do want to work with it.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,538

    Re: Dropdown box suggested list option by typing the first letter of an option

    Now everything in ThisWorkbook code module.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Dropdown box suggested list option by typing the first letter of an option

    You guys are the best! Thank you so much.

  11. #11
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Dropdown box suggested list option by typing the first letter of an option

    I apologize for opening this back up. I cannot figure out why the code trips an error when protecting the worksheets. It works fine until I protect it and what's highlighted in the debugger doesn't make much sense to me. What am I missing?

    Attached is the same spreadsheet with minor fixes and for obvious reasons, it's attached unprotected.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    08-10-2017
    Location
    Lansing, Michigan
    MS-Off Ver
    2016
    Posts
    140

    Re: Dropdown box suggested list option by typing the first letter of an option

    To be clear, I want only the yellow fields on each sheet to be unlocked and the rest of it locked.

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,538

    Re: Dropdown box suggested list option by typing the first letter of an option

    Sheets are not protected...

    Can you upload the workbook with your setting?

+ 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. vba cascading dropdown list with free text entry option
    By DerrickKhan in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-10-2017, 01:13 PM
  2. [SOLVED] Macro Help Needed to produce a new tab for each option in a dropdown List
    By karimel_romeo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-03-2017, 04:31 PM
  3. [SOLVED] If an option in dropdown list selected return value 0
    By hanif in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-28-2016, 10:16 AM
  4. Replies: 8
    Last Post: 02-16-2016, 01:50 PM
  5. using a dropdown list instead of option buttons
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2015, 10:16 PM
  6. Search by typing in first letter into dropdown box
    By kathhear in forum Excel General
    Replies: 2
    Last Post: 03-15-2013, 03:46 AM
  7. Replies: 5
    Last Post: 07-13-2006, 12:15 AM

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