+ Reply to Thread
Results 1 to 5 of 5

MultiSelect Listbox get/use Values

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407

    MultiSelect Listbox get/use Values

    I can't for the life of me figure out how to retain the selected values in a listbox.

    If this is possible, how?

    Thanks,
    Ick

  2. #2
    Forum Contributor stevebriz's Avatar
    Join Date
    09-07-2006
    Location
    Santiago Chile
    Posts
    389
    Is the listbox on fomr or in a spreadsheet?
    VBA - The Power Behind the Grid

    Posting a sample of your workbook makes it easier to look at the Issue.

  3. #3
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    On the spreadsheet from the Control Toolbox.

    Thanks.

  4. #4
    Forum Contributor stevebriz's Avatar
    Join Date
    09-07-2006
    Location
    Santiago Chile
    Posts
    389
    For multi-select you need to do something like this in a command button.
    ( set the multiselect property to multiextended)

    Private Sub CommandButton1_Click()
    For intCounter2 = 0 To Worksheets("Sheet1").OLEObjects("ListBox1").Object.ListCount - 1
    If Worksheets("Sheet1").OLEObjects("ListBox1").Object.Selected(intCounter2) = True Then
    
    strHolder2 = strHolder2 & Worksheets("Sheet1").OLEObjects("ListBox1").Object.List(intCounter2) & vbCrLf
    End If
    Next intCounter2
    
    MsgBox "The selected values are " & vbCrLf & strHolder2
    
    End Sub

  5. #5
    Valued Forum Contributor
    Join Date
    04-11-2006
    Posts
    407
    Thanks, that clears it up.

+ 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