Article ID: 124214
Article Last Modified on 8/15/2005
Sub GetSelectedListText()
' Display the dialog box.
DialogSheets(1).Show
' Set a variable named "SelectedText" to the selected
' value in the list box.
With DialogSheets(1).ListBoxes(1)
SelectedText = .List(.ListIndex)
End With
' Display the selected value in a message box.
MsgBox SelectedText
End Sub
Note: Instead of the using the ListIndex property of List, you could use
the Value property of List. The Value property for a listbox will return a
number from 1 to the number of items in the list.
Additional query words: 5.00a 5.00c 7.00a XL
Keywords: kbhowto kbprogramming kbcode KB124214