+ Reply to Thread
Results 1 to 8 of 8

Dependent Data Validation Lists

  1. #1
    Registered User
    Join Date
    01-30-2010
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    20

    Question Dependent Data Validation Lists

    Hi,
    In Excel 2007, are you able to create a dependent list via Data Validation?
    In Column A, I've created a list where the user selects a particular department (e.g. HR, Finance, IT).
    In Column B, I would like to create a list which will allow the user to select names for that particular department only (i.e. if they had selected Finance at Column A, then I only want the list at Column B to show employees working in the Finance team).

    I've tried searching this forum but am constantly receiving "fatal error" messages. Apologies if there is an answer already posted here.

    Many thanks!

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dependent Data Validation Lists

    Here is a great place to start...

    This site will walk you through step by step...

    http://www.contextures.com/xlDataVal02.html
    Attached Files Attached Files

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Dependent Data Validation Lists

    Phuag, the forum search is less than satisfactory. If you want good results, try a Google site search like

    "my search expression" site:excelforum.com

  4. #4
    Registered User
    Join Date
    01-30-2010
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Dependent Data Validation Lists

    Thanks rocky1. The attached spreadsheet was very useful for my initial enquiry. I've never written in VB before and am now trying to clear the employee name when a new dept is selected. I am able to achieve this for one row by using:

    Please Login or Register  to view this content.
    What is the syntax if I want to clear Columns E & F when any changes are made to D9 to D100?
    e.g. If D56 is changed, then E56 * F56 are to be cleared?

    I am hoping there's an easier way than writing multiple if statements!
    Last edited by PHUAG; 01-31-2010 at 12:40 AM.

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dependent Data Validation Lists

    Hi Phuag,

    I believe the first part would be changed to --
    Please Login or Register  to view this content.
    but I do not know what to do on the second --

    I tried (which I didn't believe would work) and that is confirmed, no good --

    Please Login or Register  to view this content.
    Maybe somebody else will bail me out here...
    Last edited by jeffreybrown; 01-30-2010 at 11:52 PM.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Dependent Data Validation Lists

    PHUAG and Rocky1,

    Your posts do not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  7. #7
    Registered User
    Join Date
    01-30-2010
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Dependent Data Validation Lists

    Hi again,

    I am unable to create a dependent list which is dynamic in nature. For some reason, only the first value in the list is being returned.

    Please refer to the attachment "Test" where in the "Staff to Complete Dynamic" tab at C14:C21, I want the data validation list to refer to the list of employee names which relate to that particular department. The list of names are in the Dynamic Lists tab. At C14, I tried using the data validation formula as per your instructions below but it doesn't work. Does it have anything to do with the fact that your file is Excel 03 & mine is 07 macro-enabled?

    Using Dynamic Lists

    Because the INDIRECT function only works with references, not formulas, the previous method for dependent data validation won't work with dynamic lists. Instead, you can use the following method:

    1. Create the first named range and dropdown list as described above.
    2. Create the supporting named lists, and name the first cell in each range, e.g. cell B1 is named Fruit and cell C1 is named Vegetables.
    3. Name the column in which each list is located, e.g. column B is named FruitCol and column C is named VegetablesCol
    4. For the second dropdown, choose to Allow: List, and use a formula that calculates the lookup range. For example, if the first dropdown list is in cell E2:

    =OFFSET(INDIRECT($E2),0,0,COUNTA(INDIRECT(E2&"Col")),1)Thanks.
    Attached Files Attached Files

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Dependent Data Validation Lists

    See if this does it...
    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