ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Listbox value to be placed into a textbox (https://www.excelbanter.com/excel-programming/382721-listbox-value-placed-into-textbox.html)

Corey

Listbox value to be placed into a textbox
 
I have not used a Listbox before and have populated it.
But i want when CommandButton3 is clicked, the
value HIGHLIGHTED in Listbox1 to be Placed into Textbox1.

How do i do this?

Corey

Corey

Listbox value to be placed into a textbox
 
Got:
Private Sub CommandButton3_Click()
TextBox1.Value = ListBox1.Value
End Sub

BUT, the Listbox has 2 Columns with BOUNDCOLUMN = 2

How do i get the 2nd Column Value in the Textbox instaed of the 1st ?
"Corey" wrote in message ...
I have not used a Listbox before and have populated it.
But i want when CommandButton3 is clicked, the
value HIGHLIGHTED in Listbox1 to be Placed into Textbox1.

How do i do this?

Corey

JLGWhiz

Listbox value to be placed into a textbox
 
The same way you did the value in column one. select it.

"Corey" wrote:

Got:
Private Sub CommandButton3_Click()
TextBox1.Value = ListBox1.Value
End Sub

BUT, the Listbox has 2 Columns with BOUNDCOLUMN = 2

How do i get the 2nd Column Value in the Textbox instaed of the 1st ?
"Corey" wrote in message ...
I have not used a Listbox before and have populated it.
But i want when CommandButton3 is clicked, the
value HIGHLIGHTED in Listbox1 to be Placed into Textbox1.

How do i do this?

Corey


Tom Ogilvy

Listbox value to be placed into a textbox
 
Private Sub CommandButton3_Click()
TextBox1.Value = ListBox1.Value
End Sub

works fine for me. Suggest your Boundcolumn property is set to 1.

--
Regards,
Tom Ogilvy

"Corey" wrote in message
...
Got:
Private Sub CommandButton3_Click()
TextBox1.Value = ListBox1.Value
End Sub

BUT, the Listbox has 2 Columns with BOUNDCOLUMN = 2

How do i get the 2nd Column Value in the Textbox instaed of the 1st ?
"Corey" wrote in message
...
I have not used a Listbox before and have populated it.
But i want when CommandButton3 is clicked, the
value HIGHLIGHTED in Listbox1 to be Placed into Textbox1.

How do i do this?

Corey




All times are GMT +1. The time now is 04:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com