With a MultiSelect ListBox, you cannot use the .Value of the ListBox to
return the selected item. Rather, you need to use .List(rownum, colnum)
To create a string of the selected items in column 2 of a MultiSelect list
box with the items other than the last separated by semi-colons and the word
"and" before the last item, you need to use the following code:
Private Sub CommandButton1_Click()
Dim i As Integer, j As Long, k As Long
Dim MyString As String
MyString = ""
j = 0
With ListBox1
For i = 0 To .ListCount - 1
'..and check whether each is selected
If ListBox1.selected(i) Then
j = j + 1
End If
Next i
If j > 1 Then
k = 0
For i = 0 To .ListCount - 1
If .selected(i) Then
k = k + 1
If k = 1 Then
MyString = MyString & .list(i, 1)
ElseIf k < j Then
MyString = MyString & "; " & .list(i, 1)
Else
MyString = MyString & " and " & .list(i, 1)
End If
End If
Next i
Else
For i = 0 To .ListCount - 1
If .selected(i) Then
MyString = .list(i, 1)
End If
Next i
End If
End With
MsgBox MyString
End Sub

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hi Doug,
>
[quoted text clipped - 196 lines]
>>
>> - Show quoted text -
Kerri - 15 Nov 2007 20:53 GMT
Doug, you are awesome...but you probably knew that already! I went
through the code and put comments next to each item to explain the
purpose of the i,j and k. I relisted the code with my comments. If I
didn't explain it properly would you correct me. I hope to be able to
do this on my own one day...I may never be as good as you but I'm
trying.
THANK YOU!!!!!! Kerri
Private Sub CommandButton1_Click()
Dim i As Integer, j As Long, k As Long
Dim MyString As String
MyString = ""
j = 0
With ListBox1
'*This sections is to count number of selected items
For i = 0 To .ListCount - 1 '-1 includes all columns, i=0 means
nothing selected
'..and check whether each is selected
If ListBox1.selected(i) Then
'* J refers to number of selected items - if selected
then j increases by 1
j = j + 1
End If
Next i
If j 1 Then 'If multiple items are selected
'*k is always one less than the selected items so you can
put "and" instead of ";"
k = 0
'*Gets the selected item from the list (i, 1) 1 indicates
column2 of the table bec. it
'starts w/0
For i = 0 To .ListCount - 1
If .selected(i) Then
k = k + 1
If k = 1 Then
MyString = MyString & .list(i, 1) '*no
punctuation just insert name
ElseIf k < j Then
MyString = MyString & "; " & .list(i, 1) '*if K
is less than j include " ;"
Else
'*since there is more than one item put " and"
before last item selected.
MyString = MyString & " and " & .list(i, 1)
End If
End If
Next i
Else '*if only one item is selected do this.
For i = 0 To .ListCount - 1
If .selected(i) Then
MyString = .list(i, 1)
End If
Next i
End If
End With
MsgBox MyString
End Sub
On Nov 15, 2:14 am, "Doug Robbins - Word MVP"
<d...@REMOVECAPSmvps.org> wrote:
> With a MultiSelectListBox, you cannot use the .Value of theListBoxto
> return the selected item. Rather, you need to use .List(rownum, colnum)
[quoted text clipped - 255 lines]
>
> - Show quoted text -
Doug Robbins - Word MVP - 16 Nov 2007 01:47 GMT
Yes, your understanding is correct.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Doug, you are awesome...but you probably knew that already! I went
> through the code and put comments next to each item to explain the
[quoted text clipped - 332 lines]
>>
>> - Show quoted text -