List Boxes in VBA for Excel

  Desert Andy 14:03 26 Apr 04
Locked

I am trying to progress my programming skills, and have learnt how to insert a userform in Excel. I now want to offer a list box to the user so that they can select more than one option. I have set multioption, which works. What code or instruction set do i use to find out what options the user has selected.
Thanks

Andy

  VoG II 14:16 26 Apr 04

Dim listText As String

Dim listNumber As Integer

Dim I As Integer

UserForm1.Show

With UserForm1.ListBox1

For I = 0 To .ListCount - 1

If .Selected(I) Then

listText = .List(I)

listNumber = I

MsgBox listNumber & " " & listText

End If

Next I

End With

Unload UserForm1

  Desert Andy 17:47 26 Apr 04

VoG

Thanks very much.

Very happy man, I can get on with the project.

Andy

This thread is now locked and can not be replied to.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

This abstract video touches on division in our technologic world

Best alternatives to iTunes for Mac | Best music players for macOS: Free your music from the…