Consulting

Results 1 to 3 of 3

Thread: Multi select list box

  1. #1
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location

    Multi select list box

    hopefully this is a simple question but one I have never tried before.

    I have a userform listbox with the multi select properties activated (i.e. the checkbox on the left is active), how to I loop through the list and for example show a message box for each one that is selected?

    Cheers

    Gibbo

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    This should do it

    For i = 0 To ListBox1.ListCount - 1
            If ListBox1.Selected(i) Then
                MsgBox ListBox1.List(i, 0) & " is selected"
            End If
        Next
    K :-)

  3. #3
    VBAX Expert
    Joined
    Jan 2005
    Posts
    574
    Location
    Perfert as usual

    Thanks again

    Gibbo

Posting Permissions

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