+ Reply to Thread
Results 1 to 5 of 5

VBA drop-down box

  1. #1
    Registered User
    Join Date
    11-10-2015
    Location
    Derbyshire
    MS-Off Ver
    Office 2013
    Posts
    17

    VBA drop-down box

    Hello, been musing around the forums a little asking questions and giving advice - now I have a new query which I've been stuck on this afternoon.

    I have 10 cells in a row going down, each one of those 10 cells have the same data validation in - a drop-down list with values in. Below those drop down boxes is a blank table with three columns (item code, item description and quantity). On a separate sheet, I have each of the options in the drop-down boxes as a separate table - each showing the different item, description and quantity.

    Essentially, I need a macro that will take the value from one, a few or all of the drop-down boxes and return the relevant data for the chosen option in the blank table at the bottom.

    Is this something which is possible? I nearly make break-through ideas with it, but then something lets it down last minute.

    Callum

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,667

    Re: VBA drop-down box

    Can you attach your file? Include sample data, and show an example of the result you want (you can fake the results). Explain how you would get that result from a logic standpoint, and we can explain how to implement that logic using Excel features.

    There are a few confusing things about your description:

    You have 10 dropdown lists, but only three item attributes. How do you use the 10 lists to identify criteria to look for?

    You want to "return the relevant data for the chosen option in the blank table". How do you return anything from a blank table?

  3. #3
    Registered User
    Join Date
    11-10-2015
    Location
    Derbyshire
    MS-Off Ver
    Office 2013
    Posts
    17

    Re: VBA drop-down box

    Hello and thanks for the reply. Perhaps I should have explained my query in a more coherant manner!

    When I said that there are 10 drop down lists, this means that the user can choose up to ten separate choices. The data that is returned has only three attributes. the hope would be that either formula or a macro in the blank table would recognise the choice and return values from in the information on the separate sheet.

    When I said "return the relevant data for the chosen option in the blank table" I meant to say that once a user has made a selection in a drop down box, data for that option (kept on a separate sheet) is then copied into the blank table at the bottom of the sheet.

    I have attaced the spreadsheet to this e-mail. It does contain a macro but no need to enable anything as it's not required to show my problem. I've written labels on the front page to help take you through what I need to do.

    Many thanks, Callum.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: VBA drop-down box

    I think that this will do what you want it to… Mind you it is not the prettiest coding but it works with the sample sheet you posted

    Please Login or Register  to view this content.
    If anyone can clean up coding feel free to post a better way
    Attached Files Attached Files
    Bramz

  5. #5
    Registered User
    Join Date
    11-10-2015
    Location
    Derbyshire
    MS-Off Ver
    Office 2013
    Posts
    17

    Re: VBA drop-down box

    That is excellent and it does exactly the job I need, so thank you!

    I can't really comment on cleaning up the coding as when I write VBA code, I tend to write everything out in full so that I can break down each step and insert comments so I know which bit does what. It looks messier and perhaps more complext than it needs to be, but still fully usable and good for a novice to intermediate user.

    New to the site but I have given you a reputation point.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Clear up to three dependent drop down lists based on selection in superior drop down list
    By theletterh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-04-2016, 09:31 PM
  2. Replies: 4
    Last Post: 10-28-2015, 12:59 PM
  3. Post drop down selection in html data dependent on drop down is not coming
    By wfm007 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2015, 08:57 AM
  4. Replies: 8
    Last Post: 09-22-2011, 03:47 PM
  5. Replies: 0
    Last Post: 05-27-2011, 12:01 PM
  6. Auto-update initial drop-down selection based on previous drop-downs
    By thornomad in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2010, 09:55 AM
  7. Replies: 8
    Last Post: 02-22-2008, 12:53 PM

Tags for this Thread

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