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
Hi
In the propertities set the "multiselect" property to 1 - fmmultiselectMulti
What do you want to do with the selected items?
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
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
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...
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.
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 11:18 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks