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
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
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.
On the spreadsheet from the Control Toolbox.
Thanks.
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
Thanks, that clears it up.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks