+ Reply to Thread
Results 1 to 8 of 8

Need to access certain elements in a drop down list and return values from another cell

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Need to access certain elements in a drop down list and return values from another cell

    So I have a drop down list on a sheet, of approximately 200 elements. The drop down list is in cell B3 in sheet 2.

    I'd like to write some VBA that selects particular elements of the drop down list that I choose (28 in all). For example, I would like the code to choose "Operating Margin" from the dropdown list, and then return values from other cells on that sheet (say, E5, F6, G7) to a different worksheet in the workbook.

    Then, I would like the code to chose "Gross Margin", for example, and return the same values as above, for 28 items in all.

    I'm stuck on getting the VBA to be able to choose from the drop down list. I'm not very experienced with VBA, any help would be appreciated!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need to access certain elements in a drop down list and return values from another cel

    Why do you need to choose from the dropdown list?

    How is that getting the values you want?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Need to access certain elements in a drop down list and return values from another cel

    Quote Originally Posted by Norie View Post
    Why do you need to choose from the dropdown list?

    How is that getting the values you want?
    Picking "Operating Margin" effects changes in financial calculations based on a database of financial data. It returns the operating margin (or one of the other 27 metrics I'd like to choose) for a number of different companies, as well as weighted averages and interquartile ranges for all the companies. I want the code to loop through these 28 metrics and return certain values to another sheet.

    I hope that helped. I'm not sure how to get the code to choose an element from the list, but not pick all the elements form the dropdown.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need to access certain elements in a drop down list and return values from another cel

    Can't you just plug in the value to the appropriate cell instead of picking it from the list?

    That is of course if the dropdown is linked to a cell which is used to drive the calculations.

  5. #5
    Registered User
    Join Date
    01-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Need to access certain elements in a drop down list and return values from another cel

    Quote Originally Posted by Norie View Post
    Can't you just plug in the value to the appropriate cell instead of picking it from the list?

    That is of course if the dropdown is linked to a cell which is used to drive the calculations.
    It is the case that the dropdown is linked to another cell which drives the calculations. This is part of a complicated financial model that derives its data from an online source, so it is dynamic on a number of levels. I also had no part in constructing this model, which makes it difficult to explain.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need to access certain elements in a drop down list and return values from another cel

    If the dropdown is linked to a cell you should just be able to enter your value in that cell without using the dropdown list.

    That should have the same effect as if you'd selected the value from the dropdown.

  7. #7
    Registered User
    Join Date
    01-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Need to access certain elements in a drop down list and return values from another cel

    The dropdown choices are linked to a number of cells on different sheets which hold data. These data are calculated together to return the final result, which is displayed below the drop down. Each choice in the dropdown is linked to different cells as well.

    I appreciate you taking time to walk me through this, I may not be explaining my problem well.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Need to access certain elements in a drop down list and return values from another cel

    What type of dropdown is it?

+ 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