ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pass highlighted list variable to caption (https://www.excelbanter.com/excel-programming/386490-pass-highlighted-list-variable-caption.html)

ExcelMonkey

Pass highlighted list variable to caption
 
When the user click on an item in a list, I want the name of the item passed
to a caption box. What do I pass to the caption. The following below does
not work

Private Sub ListBox1_Click()
Me.Label2.Caption = List.Selected
End Sub

Thanks

EM

ExcelMonkey

Pass highlighted list variable to caption
 
Here it is

Private Sub ListBox1_Click()
Me.Label2.Caption = ListBox1.Value
End Sub


"ExcelMonkey" wrote:

When the user click on an item in a list, I want the name of the item passed
to a caption box. What do I pass to the caption. The following below does
not work

Private Sub ListBox1_Click()
Me.Label2.Caption = List.Selected
End Sub

Thanks

EM



All times are GMT +1. The time now is 08:54 AM.

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