Try code something like this...
Dim X As Long
Dim CombinedText As String
With ListBox1
For X = 0 To .ListCount - 1
If .Selected(X) Then
CombinedText = CombinedText & " " & .List(X)
End If
Next
End With
' CombinedText now has the selected items from ListBox1
' concatenated together with a blank space between items
If you need this combined text in other procedures, then the CombinedText
variable should probably be Dim'med in a Module so it is global.
--
Rick (MVP - Excel)
"jay dean" wrote in message
...
Rick, FSt1, and Dave -
Okay, if I use a listbox like you suggested and the user selects
multiple items, I need a mcro that will concatenate the selected items
into one string, maybe, store it in a string variable.
For example: Dim Mylist as String.
If a user selects 4 items in the list being: "I like" (1st slection),
"studying" (2nd selection), "vba every" (3rd selection), and "other day"
(4th selection), then
Mylist should contain "I like studying vba every other day"
**Please note that the number of selections 4 used in the above example
is just an example. In reality, the user may select 0 items, 1 item, 2
items, 3 items, 4 itmes, 5 items,... etc.
Any help would be appreciated.
Thanks
Jay
*** Sent via Developersdex http://www.developersdex.com ***