+ Reply to Thread
Results 1 to 5 of 5

Get Multi Selection Listbox userform and clear all selection

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Get Multi Selection Listbox userform and clear all selection

    Hi, i have a listbox where the rowsource come from a name range
    call ABC. Whenever, my user select one item and click on the button. The listbox value will go to cell A1 of Template sheet and print out. The content of Template is base on formula using Vlookup. However, they hope they can multi select and print. How can that be done?

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Get Multi Selection Listbox userform and clear all selection

    Good morning jp16

    Are you using a Forms listbox, or a ActiveX listbox?
    It makes a difference, and if you are using the former, then you will need to change to the ActiveX version, which will involve a learning curve, which we can help with.

    If you are already using the ActiveX version, then this code will insert all your selections into your linked cell as a comma separated list.
    Please Login or Register  to view this content.
    HTH

    DominicB

  3. #3
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Get Multi Selection Listbox userform and clear all selection

    Hi, i am using user form listbox. I not sure whats the difference the Activex n Form control.

    Anyway, I see that the form control also has the ability to multi select from the Multiselect option.

    Hence i thot Form Listbox is possible.
    Please have a look at my sample file and advice. =)
    Attached Files Attached Files

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Get Multi Selection Listbox userform and clear all selection

    Hi jp16

    It's not clear from what you've posted how you want this formatting (across, downwards, etc), so in this example I have shown what you need to do to capture the data.
    In this instance, all we're capturing is the first column, as that is the basis of your lookup formula.

    Edit your userform, click on the listbox and in the properties window, change MultiSelect to "1 - fmMultiSelectMulti". Then replace your code with my amended code below.
    This will show a message box with your selections in it, as a string. You need to decide where you need to go from here.
    Please Login or Register  to view this content.
    HTH

    DominicB

    Edit : As you are using a userform, the form / activex statement above is irrelevant. Userforms are different again.
    Last edited by dominicb; 05-30-2018 at 06:20 AM.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Get Multi Selection Listbox userform and clear all selection

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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. [SOLVED] Userform Multi-Select Listbox Selection Condition to unhide Frame and controls
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2016, 10:05 AM
  2. pop-up multi-selection listbox
    By capson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2016, 06:10 PM
  3. [SOLVED] Clear UserForm Multi Select ListBox
    By jaslake in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2014, 12:19 AM
  4. Multi Selection Listbox
    By protocol in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-18-2011, 03:14 AM
  5. Multi select Listbox Items selection based on other Listbox item selection.
    By srinivassathi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2011, 05:53 AM
  6. [SOLVED] Fast way to clear Listbox selection
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-26-2005, 06:05 PM
  7. [SOLVED] Multi Selection in a ListBox
    By Claus Mygind in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-27-2005, 11:06 AM

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