+ Reply to Thread
Results 1 to 2 of 2

Dynamic drop down list

  1. #1
    Registered User
    Join Date
    04-08-2010
    Location
    Timisoara, Romania
    MS-Off Ver
    Excel 2003
    Posts
    23

    Dynamic drop down list

    Hello

    I have to create a dynamic drop down list that takes the values from another excel file. The problem is that the values are the names of the columns and that the number of the columns change from month to month.

    Any ideas how I can do this?
    Thank you!
    Last edited by leyaclaire; 06-18-2010 at 08:52 AM.

  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: How to create a dynamic drop down list?

    You can't create a drop down with the values from another workbook directly, you will have to get them into your target workbook as data first, construct the dynamic drop down there, then use it.

    ============
    Let's say the workbook with the values to import is Book1.xls, and the sheet is Sheet1, and the row with the values is row 1 starting at A1, then B1, then C1, etc.

    In the workbook where you are building the dynamic drop down, put this formula in A1, then copy down as far as you need to go to accommodate the expanding values (resist the urge to go down forever, make a sold range decision here, 100 rows?)

    =IF(INDEX([Book1.xls]Sheet1!$1:$1, ROW(A1))=0, "", INDEX([Book1.xls]Sheet1!$1:$1, ROW(A1)))

    That should cause the text values to appear and the cells will go blank when the values are blank in the source document.

    Then in the new workbook, use this formula to create your dynamic named range, Insert > Name > Define > MyList
    Refers To: =OFFSET($A$1,0,0,MATCH("*",$A:$A,-1),1)


    Then in the cells where you want to use this new drop down, Data > Validation > List > Source: MyList
    Last edited by JBeaucaire; 06-17-2010 at 10:40 AM.
    _________________
    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!)

+ 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