+ Reply to Thread
Results 1 to 7 of 7

Listbox with mult-selection capability

Hybrid View

ptborders Listbox with mult-selection... 02-11-2012, 12:23 PM
shakey775 Re: Listbox with... 02-11-2012, 12:39 PM
royUK Re: Listbox with... 02-11-2012, 12:55 PM
shakey775 Re: Listbox with... 02-11-2012, 01:03 PM
ptborders Re: Listbox with... 02-16-2012, 07:24 PM
mikerickson Re: Listbox with... 02-16-2012, 07:55 PM
ptborders Re: Listbox with... 02-17-2012, 11:56 AM
  1. #1
    Registered User
    Join Date
    02-10-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    6

    Listbox with mult-selection capability

    Hey...I've made listboxes in the past where the single selection feature works in that the cell reference changes numbers based on the single selection of the list box. However, I would like to "upgrade" my listbox now so that multiple items in the listbox can be selected at once and there is a cell reference that changes numbers for each item in the list box.

    I'm not versed on visual basic at all, so the simplest explanation you could offer would be much appreciated.
    Thanks for your help in advance.
    listbox.xlsx

  2. #2
    Registered User
    Join Date
    12-18-2011
    Location
    Back in Warwickshire
    MS-Off Ver
    365
    Posts
    59

    Re: Listbox with mult-selection capability

    Hi
    In the propertities set the "multiselect" property to 1 - fmmultiselectMulti

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Listbox with mult-selection capability

    What do you want to do with the selected items?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    12-18-2011
    Location
    Back in Warwickshire
    MS-Off Ver
    365
    Posts
    59

    Re: Listbox with mult-selection capability

    I thought you were using a listbox in a userform

    in the worksheet select the listbox and then click properties button on the developer ribbon
    when that opens in the control tab select the multi option button

    james

  5. #5
    Registered User
    Join Date
    02-10-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Listbox with mult-selection capability

    thanks...I attempted this solution but was not able to obtain cell references for each item in the listbox. The steps I take are as follows:

    1. Developer tab, then insert a list box form control
    2. Select the listbox, then click properties
    3. Chose the multi option and then a corresponding range and cell link

    The issue is that the cell link only refers to one cell...i'd like each item in the listbox to have a cell link when multiple items are selected...

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

    Re: Listbox with mult-selection capability

    A multi-select listbox from the Forms menu has to be driven by code rather than a cell link. Try assigning the control to a macro like
    Sub ListBox1_Change()
        Dim i As Long
        With ActiveSheet.Shapes(1).OLEFormat.Object
            For i = 1 To .ListCount
                Cells(i, 2) = .Selected(i)
            Next i
        End With
    End Sub
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  7. #7
    Registered User
    Join Date
    02-10-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Listbox with mult-selection capability

    Thanks Mike... this code worked well! As a slight modification, how would you choose which cells for the TRUE/FALSE values to populate in? Right now, B1seems to be the cell where the cell links show up.
    Last edited by ptborders; 02-17-2012 at 12:18 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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