+ Reply to Thread
Results 1 to 4 of 4

Populate a textbox in a userform using multiple selections from a combo box

  1. #1
    Registered User
    Join Date
    05-13-2013
    Location
    London
    MS-Off Ver
    Excel 2010 Mac
    Posts
    19

    Populate a textbox in a userform using multiple selections from a combo box

    Hi there,

    I've been racking my brains (and forums) trying to figure out how to solve my problem.

    I am currently building a userform, where people can select more than one object/value in a combo box that will automatically populate the textbox I select.

    At the moment, the textbox is populated with the value that is selected at that time in the combobox, but when I try to select a second value, the original one gets replace.

    Is there a way for allowing multiple entries into the textbox, and separating the entries with a comma.

    The current code I have (which works is):

    Please Login or Register  to view this content.
    Thanks in advance.
    Last edited by JBeaucaire; 05-23-2013 at 10:17 AM. Reason: Added CODE tags, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thanks.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Populate a textbox in a userform using multiple selections from a combo box

    You set the value = the value it currently is AND append the new value. I'm just guessing at your code, don't fully understand it, but this example should give you the idea:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-13-2013
    Location
    London
    MS-Off Ver
    Excel 2010 Mac
    Posts
    19

    Re: Populate a textbox in a userform using multiple selections from a combo box

    That's worked great so far, however it starts the values in my textbox with ", ". Is there a way of putting an If command so that I can put an initial entry in there from the combo box, and then add onto the existing ones in there once they're selected?

    Thanks!

  4. #4
    Registered User
    Join Date
    05-13-2013
    Location
    London
    MS-Off Ver
    Excel 2010 Mac
    Posts
    19

    Re: Populate a textbox in a userform using multiple selections from a combo box

    Sorry - I've JUST managed to figure it out.

    Your formula definitely helped though! Thank you!

+ 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