+ Reply to Thread
Results 1 to 5 of 5

How to retrive values in multi listBox

  1. #1
    Registered User
    Join Date
    05-01-2014
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    How to retrive values in multi listBox

    Hi,

    Is there a way "property" to get the value of an item that was clicked in multi listBox?

    This is what I am trying to do. I am creating 2 listboxes. The first one is the main listbox. When the user clicks on any value on the main listbox. The second listbox will populate the values associated with the selected values in main listbox. If multiple selections were selected, it will populate the values in the second listbox (real-time) based on main listbox. If any unselected in main it will remove the values in the second listbox that are associated with the unselected item in main Listbox. Example:

    AA= 1, 5, 3
    BC= 2, 7, 9
    XL= 4, 21, 61

    Main Listbox:
    AA
    BC
    XL


    If the user clicked "BC" in main. Second list it should populate "on-click"

    2
    7
    9

    Then the user clicked "AA". Second list it should populate "on-click"

    1
    2
    3
    5
    7
    9

    Then the user clicked (unselected) "BC". Second list it should populate "on-click"

    1
    3
    5

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: How to retrive values in multi listBox

    If you make a userform with two listboxes and put this code in the userform's code module, I think it will do what you want.
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    05-01-2014
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: How to retrive values in multi listBox

    Thank you Mike. It works good. One thing though, it is showing the values of ListBox2 in Listbox1 (Some of the Listbox2 values are over 10 values). Is there way to hide them?

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: How to retrive values in multi listBox

    I forgot this line
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-01-2014
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: How to retrive values in multi listBox

    Thanks again. That is exactly what I am looking for

+ 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. Multi-Macro and Multi-Listbox help
    By VBAnooob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2012, 02:55 AM
  2. 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
  3. Saving & Retrieivng Multi Select ListBox Values
    By mini12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2009, 09:27 AM
  4. Problem in Returning Values from a Multi-column Listbox (ActiveX)
    By shivboy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-16-2007, 02:51 PM
  5. [SOLVED] returning values multi column listbox
    By GeorgeFD29 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2005, 09: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