ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting a listbox item event (https://www.excelbanter.com/excel-programming/330336-selecting-listbox-item-event.html)

Todd Huttenstine

Selecting a listbox item event
 
Hey

I want to have a code run when a user selects any item in my listbox
(Listbox1). How can I make this happen?


Thanks
Todd Huttenstine


Bob Phillips[_7_]

Selecting a listbox item event
 
Get the Listbox_Click event.

--
HTH

Bob Phillips

"Todd Huttenstine" wrote in message
oups.com...
Hey

I want to have a code run when a user selects any item in my listbox
(Listbox1). How can I make this happen?


Thanks
Todd Huttenstine




Nick Hebb

Selecting a listbox item event
 
Assuming it's a listbox on a worksheet, then right-click on it in
design mode and select 'view code' from the context menu. That will
launch the VBA IDE and create a Listbox1_Change event procedure.


Chip Pearson

Selecting a listbox item event
 
You need to use the Click event of the ListBox. E.g.,

Private Sub ListBox1_Click()
MsgBox "You clicked: " & Me.ListBox1.Value
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Todd Huttenstine" wrote
in message
oups.com...
Hey

I want to have a code run when a user selects any item in my
listbox
(Listbox1). How can I make this happen?


Thanks
Todd Huttenstine





All times are GMT +1. The time now is 12:42 PM.

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