View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Combo or Checkbox

Post your code to see.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SMERTZ" wrote in message
...
I created a simple form with a OK, Cancel button and a list box. In the
form init I populated the list box. However when I select OK, it only

puts
one name in the active cell. It does not allow multiple selections.

Any Ideas


"Steve" wrote in message
...
Assuming you have a form with a filled listbox and a command button
This will drop the selected items into the active cell
You can run this from a toolbar or shortcut perhaps

Private Sub CommandButton1_Click()
Dim strnames As String
Dim x As Integer

For x = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(x) Then
strnames = strnames & ListBox1.List(x) & ", "
End If
Next x

If Not strnames = "" Then
strnames = Left(strnames, Len(strnames) - 1)
End If
ActiveCell.Value = strnames
End Sub

Steve H
"SMERTZ" wrote in message
...
I would like to add to a cell or a range of cells a data validation.
However the list box in datavalidation will not allow more than one
selection. The list will be peoples names.

Bill
Bob
Carol
Scott

I want to assign on occasion more than one person in the cell. So my
question is; Is it best to use a combo box, or maybe a form that pops

up
when someone clicks in a range of cells with a check box of names?

Can someone let me know what is the better way to go, and please

provide
an example if it is in code?

Thank You