Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting multiple values from a combo box 1

Status
Not open for further replies.

fbicfc

Technical User
Nov 13, 2002
35
GB
Hi,

I am working on a simple user input form in Excel at the moment and everything is going along swimmingly, until I was informed that the users must be able to select Multiple categories from a combobox.

The categories are held in a separate sheet in the format of Column 1 = 3 digit alpha Column 2 = Description Var

What I need to know is if it is possible to select multiple values from the combobox(This can be done one at a time), and then insert the selected multiple categories into a single cell separated with a comma.

The big problem I am having with this is that the end user form will be used in Excel for MACs and I am using a Windows PC to create the form.

Any thoughts or suggestions are appreciated.

Cheers

FBICFC
 
Hi fbicfc,

If you want to allow multiple selections, use a listbox instead of a combobox, and set its multiselect property to 1 or 2.

You can run through all the items and build up a string, for example

str = ""
for i = 0 to me.listbox1.listcount-1
if me.listbox1.selected(i) then
str = str & "," & me.listbox1.list(i)
end if
next
str = mid$(str,2)

Enjoy,
Tony
 
Cheers for this Tony, works great.

Fbicfc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top