+ Reply to Thread
Results 1 to 11 of 11

Userforms transfering list Listbox.list's

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Userforms transfering list Listbox.list's

    Hi,

    I've got 2 userforms. The first one appears on a commandclick. If the user clicks on a specific button on the first userfom, the second userforms is shown. The user can then proceed to chose some values from a listbox. When he clicks ok, I'd like the array which consists of the listbox.list to be transfered to the first userform.

    Anyone knows how to make it work? I'm pretty sure that it aint a hard task but I lack the knowledge when it comes to userforms :/
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userforms transfering list Listbox.list's

    Something like this maybe

    Listboxes.xlsm
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Userforms transfering list Listbox.list's

    Not suprised to see a a quick response from mike7952! This seems to work. Thanks.

    Last question before I mark this as solved: What changes must be done to your code, to make listbox values get transfered to a textbox instead listbox?

    Please Login or Register  to view this content.
    doesn't seem to do it ..

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userforms transfering list Listbox.list's

    Something like this maybe.

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Userforms transfering list Listbox.list's

    Please Login or Register  to view this content.
    Doesn't seem to do the trick - Could not get the List property. Invalid property array index.
    Last edited by Bishonen; 10-08-2012 at 03:48 AM.

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userforms transfering list Listbox.list's

    This works for me

    Listboxes_v2.xlsm

  7. #7
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Userforms transfering list Listbox.list's

    I don't know what I have done wrong previously but now it seems to be working. The downside of your code seems to be the fact, that it only moves the last value. Thanks a lot for your time. If you can come up with how to transfer all the values from the listbox then I'd sacrifice a goat in your name!

    testmike.xlsm

  8. #8
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userforms transfering list Listbox.list's

    If your textbox is set to multiline then try this

    Please Login or Register  to view this content.

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Userforms transfering list Listbox.list's

    Set the Textbox Multiline property to True an use this

    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Re: Userforms transfering list Listbox.list's

    works like a charm. Muchos Gracias! :}

  11. #11
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Userforms transfering list Listbox.list's

    @Bishonen, checked, rechecked the tube and .... nothing. the clock is ticking.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

+ 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