Lawrence Salvucci
asked on
ActiveX Listbox Multi Select in Excel 2010
I need to be able to extract the multi selected values from my listbox on my worksheet. When I had it set to single selection I had the linked cell set so it would put the value in a specific cell. But now I need to change this to a frmMultiSelectExtended option. How do I extract the selections and have them be put in column A starting in row 50 and just incrementing from there? No clue how to do this in the code for the Click event of the listbox.
ASKER
Thank you, Why is it a bad idea?
Because they aren't designed to be used on a worksheet and you can run into problems where the controls shrink or the font size changes. This article talks about it.
ASKER
I'm guessing that a form control listbox would work better on a worksheet?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm guessing that a form control listbox would work better on a worksheet?They have their own problem in that the font is small and it can't be made bigger.
ASKER
I'm gonna stay with what I have for now. Thank you for the insight and the help with the code.
You could try it this way and if it works you don't need mlngRow.
In any case you're welcome and I'm glad I was able to help.
If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.
Marty - Microsoft MVP 2009 to 2016
Experts Exchange MVE 2015
Experts Exchange Top Expert Visual Basic Classic 2012 to 2016
Private Sub ListBox1_Change()
Dim lngLastRow As Long
lngLastRow = Range("A1048576").End(xlUp).Row
If ListBox1.Selected(ListBox1.ListIndex) = True Then
Cells(lngLastRow + 1, "A") = ListBox1.List(ListBox1.ListIndex)
End If
End Sub
In any case you're welcome and I'm glad I was able to help.
If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.
Marty - Microsoft MVP 2009 to 2016
Experts Exchange MVE 2015
Experts Exchange Top Expert Visual Basic Classic 2012 to 2016
Open in new window