+ Reply to Thread
Results 1 to 5 of 5

Program List boxes

  1. #1
    Registered User
    Join Date
    11-23-2018
    Location
    germany
    MS-Off Ver
    2016
    Posts
    2

    Program List boxes

    Dear Community,

    I would like to set up a tool to analyze a nutrition survey.
    There are about 40 different foods. For each food the subjects are asked about the times eaten in the last month (from never to a couple of times a day) and about the amount of portions (from 1/4 to 3)
    There is a list to translate the question about the frequency into a number (times per month) and a list of how big a portion is for each food. From these data one can calculate the amount eaten by the subject.

    I don't want to type everything in by hand. My idea was to have two list boxes with the possible answers, one for the frequency and one for the portion size.
    Can you program them to spit out something else then 1, 2, 3,...? But actually the numbers in the list like 168 a week for the answer 5 times a week. Or can you set up another field with a what if function like: if 1 then 0, if 2 then 1, ..., if 11 then 168?

    I appreciate your help

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Program List boxes

    Hi and welcome to the forum.
    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-23-2018
    Location
    germany
    MS-Off Ver
    2016
    Posts
    2

    Re: Program List boxes

    here is the sheet
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Program List boxes

    Have you considered Data Validation cells for capturing data? Once you've captured data you can use other cells to deduce things like related scores

    I can't tell from your workbook how you actually use it or what any results should look like therefore please upload a version which shows what the data looks like when you have captured it and what any dependent cells should contain. And be sure to explain clearly how you arrive at the dependent cell values.

  5. #5
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Program List boxes

    Hi julianhg,

    I hope I got what you mean.

    Maybe using a vlookup.
    The user needs just one listbox for the frequency.

    can you set up another field with a what if function like: if 1 then 0, if 2 then 1, ..., if 11 then 168?
    Assuming that the "per month" you want to appear in column W, then in W6 put a formula =VLOOKUP(U6,I5:K15,3,FALSE)
    and have column i (column helper) with a number from 1 to 11 starting from cell i5 to i15.

    For example if the user choose "4-5x day" in the listbox,
    then in cell U6 will have a value 10
    and then in cell W6 (the one with the formula) will give a value 126.
    Last edited by karmapala; 11-23-2018 at 06:19 PM.

+ 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. Using List boxes and text boxes with complex data sets
    By Mlanger575 in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 11-06-2016, 01:11 PM
  2. Is it possible to program a command button with check boxes?
    By DB121 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2016, 12:25 AM
  3. [SOLVED] Clearing combo boxes at end of program
    By TRLWNC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2016, 07:04 AM
  4. populating list boxes and combo boxes in a user form.
    By ahceinaej in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2014, 11:54 AM
  5. Multichoice list boxes and use of Dictionary (3 cascading list boxes)
    By jerem123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2013, 09:45 AM
  6. Vlookup combo boxes and list boxes
    By marissan1 in forum Excel General
    Replies: 2
    Last Post: 10-06-2011, 09:49 AM
  7. [SOLVED] Selecting subsets using combo boxes or list boxes
    By CLamar in forum Excel General
    Replies: 0
    Last Post: 06-01-2006, 02:45 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