Excel VBA UserForm Listbox Get Selected Item

Published: 03 February 2015
on channel: InAnOffice
10,357
30

Excel VBA UserForm Listbox Learn how to get selected item.

The source code used in this video:


Private Sub cbOK_Click()
If lbDays.ListIndex = -1 Then
MsgBox "Nothing selected"
Else
MsgBox "Selected item: " & lbDays.Value
End If
End Sub

Private Sub UserForm_Initialize()

With lbDays
.AddItem "Monday"
.AddItem "Tuesday"
.AddItem "Wednesday"
End With

End Sub


Watch video Excel VBA UserForm Listbox Get Selected Item online without registration, duration hours minute second in high quality. This video was added by user InAnOffice 03 February 2015, don't forget to share it with your friends and acquaintances, it has been viewed on our site 10,357 once and liked it 30 people.