+ Reply to Thread
Results 1 to 4 of 4

Multiselect Listbox

  1. #1
    Registered User
    Join Date
    10-09-2017
    Location
    Stavanger, Norway
    MS-Off Ver
    O365
    Posts
    78

    Multiselect Listbox

    I have a 2 column, 20 row multiselect Listbox in a user form with source data from range ("C19:D38"). I have a command button to "Select All", "Select None" and "Save Selcted".
    I want the "Save Selected" Command Button" to return a 1 or 0 into cells E19:E38, depending on which values in the Listbox are selected.
    This is being done in the Sheet called ("CashFlow")

    All my VBA skill are learnt from here so not high proficient.. Any help out there.. much appreciated.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Multiselect Listbox

    You didn't give the name of the button or the name of the list box. So you will have to make adjustments. Add this code to the code for the UserForm:
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-09-2017
    Location
    Stavanger, Norway
    MS-Off Ver
    O365
    Posts
    78

    Re: Multiselect Listbox

    6StringJazzer: That was very clean and effective.. I'll change the Command Button and Listbox names to fit my model... What would I need to change to make this dynamic, and hence not having to use a command button to save the selected items.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Multiselect Listbox

    I'm not sure what you want from the user's point of view. Do you want to change the cell contents every time the user clicks on an item, to either select or deselect it? You can't detect which individual row was clicked, so you have to check all rows every time there is any change in selection. But this is very fast so you won't notice. You would simply replace
    Please Login or Register  to view this content.
    with
    Please Login or Register  to view this content.

+ 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] Listbox Multiselect
    By Cyril Beki in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-19-2021, 01:06 AM
  2. [SOLVED] Listbox Multiselect
    By jimpatel1993 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-16-2021, 08:31 AM
  3. Copy Selected items from multicolumn, multiselect listbox to another listbox
    By Willigb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 11:27 AM
  4. Multiselect ListBox can't find the name
    By ChrisNor in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-09-2009, 09:50 AM
  5. Listbox (MultiSelect)
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2008, 11:58 PM
  6. [SOLVED] Multiselect Listbox use
    By RKS in forum Excel General
    Replies: 1
    Last Post: 05-12-2006, 10:10 AM
  7. [SOLVED] Bug in multiselect listbox?
    By Jos Vens in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2006, 04:45 PM

Tags for this Thread

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