List Boxes in VBA for Excel

  Desert Andy 14:03 26 Apr 2004

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.


  VoG II 14:16 26 Apr 2004

Dim listText As String

Dim listNumber As Integer

Dim I As Integer


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 2004


Thanks very much.

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


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

Elsewhere on IDG sites

The Evil Within 2 review-in-progress

InVision Studio takes on Adobe XD and Sketch

Camera tips to take better iPhone photos

Comment transformer un iPhone en borne Wi-Fi ?