obtain value from selected listbox item
Posted on 2014-01-03
I have listbox with values, if I click on the selected value I get a message showing the depicted list box item from the list i.e. like so:
Private Sub ListBox1_Click()
MsgBox "Selected Value is " & ListBox1.Value & ""
1) how do I get the select value to display in an excek worksheet i.e. on sheet 1 field b1?
2) how do I get a listbox1.value to display and parse in SQL statement on a DB connection i.e.:
strSQL = "SELECT * FROM MYTABLE WHERE PARAMETER = ListBox1.Value ?
would be glad for your assistance