![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: ITALY
Posts: 16
|
Hi,
I need to have a combo-box from which I could operate multiple selection at a time and have each selected element being copied in the following cell of my column. Thanks in advance for your help. Cheers, Stefano |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Greenwood, SC
Posts: 677
|
Firstly, I do not believe you can use a combobox to do multi-selects. I think you need a listbox.
To do this you simply need to put the listbox on your form (or worksheet) and set the MultiSelect property to 1-fmMultiSelectMulti To get the data into your worksheets, simply loop through the selected array of the listbox and write the data to your sheet: dim i as Integer dim iCount as Integer iCount = 1 For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) = True Then Cells(iCount,1).value = ListBox1.List(i) iCount = iCount + 1 Next This example assumes writing to the first column in successive rows. Let me know if you need more, K |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Location: ITALY
Posts: 16
|
Thanks a bunch.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|