+ Reply to Thread
Results 1 to 6 of 6

Data validation list that depends on partially matched data?

  1. #1
    Registered User
    Join Date
    03-10-2010
    Location
    VA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Data validation list that depends on partially matched data?

    I have 2 worksheets, one has a list of zip codes in column A (all unique) and names in column B, and the other sheet will have the user entering a zip code in column A and column B needs a data validation list that only contains rows from sheet 1 that have a zip code matching the user input, but I need all of the partial matches in the drop down list. So if the user types 385 in A1, B1 will have a drop down list with all of the rows in the zip code list that start with 385. I found a lot of sites on google that talk about making one list that is dependent on the selection of another list, but didn't see anything quite like this.

    Post 4 has my sample sheet/expected results.
    Last edited by stikxs; 03-11-2010 at 05:24 PM.

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

    Re: Data validation list that depends on partially matched data?

    Hi Stikxs, welcome to the forum.

    Make it easy for us to help you by mocking a sample workbook showing the data and your desired results, point out where the results came from if not obvious in your sample data. Don't oversimplify the sample data.

    Click GO ADVANCED and use the paperclip icon to post up your workbook.
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    12-21-2009
    Location
    lisbon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Data validation list that depends on partially matched data?

    Quote Originally Posted by stikxs View Post
    I have 2 worksheets, one has a list of zip codes in column A (all unique) and names in column B, and the other sheet will have the user entering a zip code in column A and column B needs a data validation list that only contains rows from sheet 1 that have a zip code matching the user input, but I need all of the partial matches in the drop down list. So if the user types 385 in A1, B1 will have a drop down list with all of the rows in the zip code list that start with 385. I found a lot of sites on google that talk about making one list that is dependent on the selection of another list, but didn't see anything quite like this.
    is it something like this? or i got it wrong?


    (i made an easy example)
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-10-2010
    Location
    VA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Data validation list that depends on partially matched data?

    Quote Originally Posted by ginganababy View Post
    is it something like this? or i got it wrong?


    (i made an easy example)
    Sorry, not quite what I'm looking for. Here is a sample sheet. What I'm looking for is for the cells under "location #" to be where the user enters a number code. The values to compare with are column A on sheet 2. I want to make the "location name" cells a drop down data validation list, where the list is made up of values from sheet 2, column B that have column A values that match what the user typed in under "location #". So if the user types in 012 under "location #" I want the drop down list under "location name" to have base1 in it, but if the user types in 421 I need the drop down list to have base3 and base4 in it. Also if they type in 901, the list needs to have base6 and base7 in it.

    Since the list would be changing, I wasn't sure if the solution would have to be a mix of using vba in worksheet_change() or if there was some other way to do it with a custom data validation using functions I'm not familiar with.

    Thanks guys.
    Attached Files Attached Files

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

    Re: Data validation list that depends on partially matched data?

    These are called Dependent Drop Down lists. I've set up named ranges on Sheet 2 so that you can use those ranges in Data validation lists. Have a look.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-10-2010
    Location
    VA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Data validation list that depends on partially matched data?

    That's close but I was aiming to only have 1 drop down, in the "location name". The values in the drop down would change with what the user has typed in the adjacent cell under "location #".

+ 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