+ Reply to Thread
Results 1 to 9 of 9

Reading from drop down lists

  1. #1
    Registered User
    Join Date
    10-22-2009
    Location
    amsterdam, netherlands
    MS-Off Ver
    Excel 2003
    Posts
    31

    Reading from drop down lists

    Hi All,

    I have a drop down list in my excel sheet that contains names of manufacturers. What i would like to do (using vba) is display some details of each manufacturer that will be copied from a different sheet.
    So my question is, how can i read the string from the drop down list on one sheet and then copy a cell from another sheet.

    Thanks for the help in advance!
    Last edited by ya7omar; 01-12-2010 at 03:28 AM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Reading from drop down lists

    Hi,

    this link will put you on track

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Reading from drop down lists

    I think you simply need to use VLOOKUP and Data Validation, take a look at the vLOOKUP example here

    http://excel-it.com/excel_functions.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    10-22-2009
    Location
    amsterdam, netherlands
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Reading from drop down lists

    Thanks for the reply.

    The only problem with Vlookup is that i have a huge list and 3 criterias to filter from. I was thinking of using a case statement in vba, i am attaching a mock file to get a better idea of what i'm trying to do.
    So when the user chooses the brand, color, and type of the car the price should be displayed in cell D1. I have hundreds of entries and so thought that using a case statement to divide it into Sedan/SUV and then further into the model would be much more practical.

    Is this possible to do in vba.

    Thanks

  5. #5
    Registered User
    Join Date
    10-22-2009
    Location
    amsterdam, netherlands
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Reading from drop down lists

    Of course i forgot to attach the file
    Attached Files Attached Files

  6. #6
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Reading from drop down lists

    I have concatenated the fields and done a lookup (index+match). Please see the attachement

    rgds

    johnjohns
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-22-2009
    Location
    amsterdam, netherlands
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Reading from drop down lists

    Thanks Johnjohn,

    It works perfectly, the only issue is that with about 600 entries it looks bad to have them all in one column, I tried changing the formula to include all the fields as you can see from the attachment but it gives me a reference error. Is there a way around this?

    Thanks
    Attached Files Attached Files

  8. #8
    Forum Contributor johnjohns's Avatar
    Join Date
    11-19-2007
    Location
    Dubai, UAE
    MS-Off Ver
    2003 and 2007
    Posts
    526

    Re: Reading from drop down lists

    If you want to keep the colors columnwise, then concatenate only the company name and vehicle type and do a 2way lookup. See the attachment. Also I have moved your list items to another sheet. To read from another sheet (data validation list) you have to name the ranges.

    rgds

    johnjohns
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-22-2009
    Location
    amsterdam, netherlands
    MS-Off Ver
    Excel 2003
    Posts
    31

    Re: Reading from drop down lists

    Thanks for the help works perfectly.

+ 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