List Boxes in VBA for Excel

  Desert Andy 14:03 26 Apr 04

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 04

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 04


Thanks very much.

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


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

Surface Pro 5 News - release date, UK price, features, specs

Animator Emanuele Kabu’s psychedelic video is a stunning tribute to Lisbon city

Best Mac antivirus 2017