get selected value from a listbox

NT100

Registered User.
Local time
Tomorrow, 05:58
Joined
Jul 29, 2017
Messages
148
Hi,

I've a listbox below.

List0.RowSourceType = "Value List"
List0.RowSource = ""

List0.AddItem "1"
List0.AddItem "2"
List0.AddItem "3"

How do I get the value of 2 if a user select 2, the 2nd row of the list0?

Thanks in advance.
 
it would simply be Me.list0. the value of the listbox would be whichever item is selected. if there are more than one column in the listbox you can reference that by using Me.List0.Column(1) or me.list0.column(2). Note that the columns are zero based so the the first column is Column(0).
 

Users who are viewing this thread

Back
Top Bottom