+ Reply to Thread
Results 1 to 9 of 9

Userform code; multiple selections output to

  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    washington
    Posts
    20

    Userform code; multiple selections output to

    This question likely shows just how new I am to this, but I haven't been able to find the answer here yet after searching.

    For clarity: I need a userform to popup when the icon in a given cell in each row is clicked, with multiple options of which more than one can be selected, and the options selected will populate that cell or if that isnt possible or it is much easier a adjacent cell. (the intention is to mimic the functionality of a drop down list but with multiple entries )

    Example: a survey report on customers who may have multiple products by same vendor. So each row would have a column "Products Owned" (and the userform would give the options; TV, Stereo, Phone, Camera, etc. etc.)
    The user would select say; TV and Phone, and either hit ENTER or have a button that says OK, then the cell "Products Owned" would populate with; (TV, Phone )

    I have followed some other examples to building a userform that allows the selection of multiple options, from here
    and it looks great.

    The only problem is the examples I followed were just for the creation of the userform pulling from my data and allowing for multiple selections... It did not show how to code it to output those selections to a cell. (I'm not sure if an "ok" button would be better or the use of the "Enter" key. either would get me by)

    Can anyone help with what the code would be to do this. The complete beginning to end would be great as though I will eventually get up to speed on this, and am actually excited about it... first draft of this worksheet is supposed to be reviewed in a day or less.



    Thank you in advance for your help.
    Last edited by fau5tu5; 07-02-2008 at 04:41 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Can you attach what you have so far?
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-02-2008
    Location
    washington
    Posts
    20

    Simple example

    I can't attach the actual example due to content however I have attached a simple example which I think will illustrate my problem and how I have attempted to solve it (or not!). Included are three worksheets; the first is the example, second the named sources, and the third is the desired outcome. If I have not gone about getting to the desired outcome the right way, PLEASE recommend another method (in detail, please ) Still very new at this point. Thanks very much!!!
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this, the user makes the selection & the selected items are listed in the activecell on closing the userform.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-02-2008
    Location
    washington
    Posts
    20

    Almost perfect...

    That looks like it's almost going to work! Thanks!

    How do you 'lock' the active cell to the actual cell where the 'button' was selected? Currently, any cell selected/clicked within the workbook can become the output cell.

  6. #6
    Registered User
    Join Date
    07-02-2008
    Location
    washington
    Posts
    20

    Still need to lock cell to be populated. SOOO close

    This is sooooo close to being fully functioning..

    The only thing I need is to know how to set the population cell to be the same cell as the original cell clicked to bring up the userform.

    Currently any cell that that is active beforehand, (say AG4 which has its own dropdown data fill ) will become the output cell for the userform we have created (in AM6 say), overriding the data in in AG4 and not populating AM6 as desired.

    Could this be an issue with associating the image/icon that runs the userform with activating the cell in which it resides? If so how do I do that?

    Or does it need more code that does this?

    In short, I need the output or populated cell to be locked/linked? with the cell which originated the userform.

    Thanks in advance. Again.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I've amended the code slightly and used the Worksheet_SelectionChange to trigger the userform. This only works on C2:C10, but you can amend that. You don't need the buttons.
    Attached Files Attached Files
    Last edited by royUK; 07-03-2008 at 03:47 AM.

  8. #8
    Registered User
    Join Date
    07-02-2008
    Location
    washington
    Posts
    20

    See the new code, but no effect, what am I missing:"?

    It appears that the spreadsheet looks and works the same as before.

    I do see the added code to the worksheet panel in VBA editor, but

    The worksheet still has the icons and it still propagates the last cell activated.

    Was there something I was supposed to do to have this function as desired in the example? Or was the spreadsheet supposed to work as desired? Keep in mind I am new to all this, so if there was some common sense action I was supposed to take, let me know, as clearly I am not familiar with it.

    Thanks again for all your help.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by fau5tu5
    It appears that the spreadsheet looks and works the same as before.
    the worksheet looks the same as before, it does act the same. The userform will display only when a cell within C2 to C10 is selected.
    I do see the added code to the worksheet panel in VBA editor, but
    have you tried to understand what the code is there for - it limits the cells that can activate the form and displays the form when one of the cells is selected.
    The worksheet still has the icons and it still propagates the last cell activated.
    They just need deleting.
    .

+ 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