+ Reply to Thread
Results 1 to 9 of 9

Assign values to dropdown menu selections

  1. #1
    Registered User
    Join Date
    08-22-2011
    Location
    St. Paul, MN
    MS-Off Ver
    Excel 2010
    Posts
    13

    Assign values to dropdown menu selections

    Hello,


    I have a dropdown menu in cell A9 with 5 selections in it. I want 4 of the selections to have cells automatically populate when they are selected (I have embedded IF statements into the cells that I want to change). However, I want to have one of the selections in the dropdown menu be an "open" selection, where I can enter in my own values in the same cells that would be populated if one of the other 4 selections were picked.

    Does anybody know how I can tell the IF statement to allow me to input my own data when the "open" selection is chosen, while still re-populating the fields when the other 4 selections are picked?

    Unfortunately, I can't upload an example because there is private information that I can't share. If you want me to clarify anything, please let me know!

    Thanks!
    Last edited by gugg7378; 08-24-2011 at 04:24 PM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Assign values to dropdown menu selections

    This needs quite a bit of clarification:
    Is the source of your dropdown a form control, an active X control, or data validation?
    Do you want formulas in your target cells to evaluate your "dropdown" selection or will you be updating hard coded values based on dropdown selection?

    Can you provide a mockup of what you'd like to occur in an example spreadsheet?
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    08-22-2011
    Location
    St. Paul, MN
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Assign values to dropdown menu selections

    Sorry, its data validation. I forgot to add in the formula that I currently have, which should help clarify things a bit.

    Please Login or Register  to view this content.
    I need help at the very end of the formula, where it says IF(A9="Open",HELP,....

    I want to be able to freely enter whatever values I want when the "Open" selection is chosen.

    Hope this helps, and thanks for the quick response!

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Assign values to dropdown menu selections

    OK - you've got your formula pulling values from various cells on sheet 3 based on what's in cell A9. Does A9 contain the validation? I'm assuming it does, and that the choices are:
    "Wellness","Healthy Back Non-Incentive","Healthy Back Incentive","Open"

    If the user choses Open in cell A9, do you then want the ability to edit A9 and put in some other value?

    Right now your formula will display values from sheet 3 based on selection but will not "populate" other cells.

    Can you clarify? Also, a mockup would be very useful...

  5. #5
    Registered User
    Join Date
    08-22-2011
    Location
    St. Paul, MN
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Assign values to dropdown menu selections

    If the user selects "Open" in A9, I want the cells that would have been populated if a different choice was selected in the dropdown menu to be editable to whatever the user would like them to be.

    Think of all other selections in the dropdown menu as guidlines or pre-set values, but the "Open" selection allows them to create their own guidlines.

    Also, I'm working on a mock-up. Should be done shortly.

  6. #6
    Registered User
    Join Date
    08-22-2011
    Location
    St. Paul, MN
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Assign values to dropdown menu selections

    Here is a reference doc.

    I have put the formula in cell B10, but it will eventually be populated down and over so all of the cells are populated.

    When "Open" is selected, I want to be able to add in my own value in cell B10. However, when I select a different option in the dropdown menu, I want it to reference back to the cell from the formula.

    Hope this helps.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-22-2011
    Location
    St. Paul, MN
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Assign values to dropdown menu selections

    Sorry for the confusion in how I have been wording my issue. If it is possible, I would like to have my formula in the attached document from my previous post to only apply to the four of the five selections within the dropdown box (I want the "Open" selection to not have any formula attached to it so I can enter in my own info.) I would also like the formula to re-apply if I would choose to go from the "Open" selection to any of the other selections where the formula would apply again.

    Hope this is easier to understand!

  8. #8
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Assign values to dropdown menu selections

    See attached workbook. Note that it doesn't rely on formulas at all, but on two VBA sub routines.

    The first is the Worksheet_Change event attached to sheet 1. When the range A10 on that sheet changes in value, it then calls the FillTable sub routine. The FillTable routine relies on named ranges which correspond to the items in the drop down list. In order for that to work, I had to replace spaces and hyphens with the underscore character since those are forbidden characters in named ranges. Macros MUST be enabled for this to work.

    Let me know if this does the trick for you.

    Regards,
    Tom
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-22-2011
    Location
    St. Paul, MN
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Assign values to dropdown menu selections

    Thanks a ton! It worked perfectly and made much more sense than the way I had originally approached 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