Can not get value from listBox to Variable.
My code: ListBox1 -> RowSource = A:A
UserForm_Activate() -> ListBox1.RowSource = "A1:A" & N (# of names in
Col,A1)
This part works, but can't get user selection to Variable. Need help
Thanks,
GJ
Dave Peterson - 11 Jun 2007 20:43 GMT
Dim myVar as string
with me.listbox1
if .listindex = -1 then
'nothing chosen
myvar = "Make a choice" '????
else
myvar = .value
end if
end with
may work.
> Can not get value from listBox to Variable.
> My code: ListBox1 -> RowSource = A:A
[quoted text clipped - 4 lines]
> Thanks,
> GJ

Signature
Dave Peterson
Jim Rech - 11 Jun 2007 20:49 GMT
For Counter = 0 to Listbox1.ListCount - 1
If Listbox1.Selected(Counter) Then
MsgBox Listbox1.List(Counter)
End If
Next

Signature
Jim
| Can not get value from listBox to Variable.
| My code: ListBox1 -> RowSource = A:A
[quoted text clipped - 4 lines]
| Thanks,
| GJ