Results 1 to 4 of 4

Thread: RESOLVED - Return a String of Selected Items in Listbox

Threaded View

  1. #1

    Thread Starter
    Member Suidae's Avatar
    Join Date
    Nov 2001
    Posts
    52

    RESOLVED - Return a String of Selected Items in Listbox

    I have a listbox that is populated with years.

    2001 <-Selected
    2002 <-Selected
    2003
    2004 <-Selected
    2005

    I want to return a string based upon the selections made.

    Example: 2001,2002,2004

    Code:
        Dim z As Integer
        Dim Ystr as String
    
          For z = 0 To (lstForecastYears.ListCount - 1)
            If lstForecastYears.Selected(z) = True Then
                Ystr =  lstForecastYears.List(z)
            End If
                Msgbox Ystr
            Next
    I'm returning the correct selections but how do I get into a string format with the delimiters?

    Thanks.
    Last edited by Suidae; Jul 8th, 2003 at 05:14 PM.
    I'm a misanthropic philanthropist!
    Frog, the only white meat...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width