+ Reply to Thread
Results 1 to 7 of 7

data validation & linking box's

  1. #1
    Registered User
    Join Date
    09-24-2007
    Posts
    14

    data validation & linking box's

    Hi Folks

    I have two csv files of vehicle makes and models, I am attempting to make drop down box with the validation tool in excell i use office 2007.

    I can make the box and know how to enter the data but i what i dont know is how to link the models to the makes.

    This basically what i would like to do.

    box one, references data from a worksheet of makes
    box two references data from a worksheet of models where the make column matches


    I have attached both both files of makes and models, if anyone can help it would be appreciated.
    Attached Files Attached Files

  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 & linking box's

    In the sheet VehicleMakes.xlsx, click on INSERT > NAME > DEFINE

    Names: Alfa_Romero
    Refers to: =[vehicle_makenmodel.xlsx]vehicle_makenmodel!$B$1:$B$18
    ADD

    Names: Audi
    Refers to: =[vehicle_makenmodel.xlsx]vehicle_makenmodel!$B$19:$B$52
    ADD

    ...etc...create a named range for every company...with _ instead of spaces in the two-word company names.

    Next, click on B1 and go to Data Validation
    Allow: List
    Source: =INDIRECT(SUBSTITUTE($A1," ","_"))
    OK

    Then copy that cell down.
    _________________
    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
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: data validation & linking box's

    Another Approach is:
    Please Login or Register  to view this content.
    See file

    PS: one book and two worksheets
    Last edited by contaminated; 06-29-2009 at 05:02 PM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  4. #4
    Registered User
    Join Date
    09-24-2007
    Posts
    14

    Re: data validation & linking box's

    Quote Originally Posted by JBeaucaire View Post
    In the sheet VehicleMakes.xlsx, click on INSERT > NAME > DEFINE

    Names: Alfa_Romero
    Refers to: =[vehicle_makenmodel.xlsx]vehicle_makenmodel!$B$1:$B$18
    ADD

    Names: Audi
    Refers to: =[vehicle_makenmodel.xlsx]vehicle_makenmodel!$B$19:$B$52
    ADD

    ...etc...create a named range for every company...with _ instead of spaces in the two-word company names.

    Next, click on B1 and go to Data Validation
    Allow: List
    Source: =INDIRECT(SUBSTITUTE($A1," ","_"))
    OK

    Then copy that cell down.
    thanks for response but i dont quite understand this , i am just a beginner, sorry i should have said

  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 & linking box's

    Dunsdale, those are step by step instructions on how to setup the dependent drop down lists.

    You have to create a NAMED range for every one of the company names. A named range is a group of cells that you refer to by NAME. Instead of A1:A10, you give those cells a name of "Ford" and then you can use that name in formulas or in Data Validation. Does that make sense?

    So, step by step, this is how you make a named range. You'll need to open the Make & Models book so you can see what the ranges in the B column should be.

    Then, in the sheet VehicleMakes.xlsx, click on INSERT > NAME > DEFINE

    Names: Alfa_Romero
    Refers to: =[vehicle_makenmodel.xlsx]vehicle_makenmodel!$B$1:$B$18
    ADD

    Names: Audi
    Refers to: =[vehicle_makenmodel.xlsx]vehicle_makenmodel!$B$19:$B$52
    ADD

    ...etc. Continue creating a named range for every company. Named ranges can't have spaces, so we replace the spaces between words with _ instead of spaces in the two-word company names. So "Alfa Romero" becomes a named range of "Alfa_Romero". OK?

    Now, let's add the Data Validation to column B. Click on B1 and go to Data > Validation

    Allow: List
    Source: =INDIRECT(SUBSTITUTE($A1," ","_"))
    OK

    Your drop box arrow should appear in B1. Click on it and you will see all the cars that match the "make" to the left in A1. Once you have that cell working properly, copy that cell down the rest of the B column and all your named ranges will kick in.


    Column B is using the INDIRECT() method to grab the "word" in column A and go find the named range of cells that match that word. So if the word in column A is "Chrysler", and you previously defined a named range s "CHRYSLER" and pointed to the correct cells in the other workbook, those cars should be in the drop list now.

  6. #6
    Registered User
    Join Date
    09-24-2007
    Posts
    14

    Re: data validation & linking box's

    Quote Originally Posted by JBeaucaire View Post
    Dunsdale, those are step by step instructions on how to setup the dependent drop down lists.

    You have to create a NAMED range for every one of the company names. A named range is a group of cells that you refer to by NAME. Instead of A1:A10, you give those cells a name of "Ford" and then you can use that name in formulas or in Data Validation. Does that make sense?.
    Thanks i think i can have a bash now, it was the named range i was not understanding.

    I have never been taught excel by anyone completely learned what i know, witch is little lol, by myself and reading articles here and there.

    Thanks for the prompt answer i will have another go now.

  7. #7
    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 & linking box's

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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