Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox click event not working 1

Status
Not open for further replies.

Chats

Technical User
Mar 12, 2002
88
GB
Can somebody explain to me how the click event works on a listbox.

I have a userform in Excel, with a listbox(Listbox1). When I run this test code, the msgbox is shown each time the listbox is clicked.

However, when I set the listbox to multiselect, the msgbox is no longer shown.

Code:
Private Sub ListBox1_Click()
    MsgBox ("Clicked me")
End Sub

My problem is that I want to seperate the events of a change to the listbox values through the user interface, and through update via VBA code. I therefore need an event which will respond to changes through the user interface, but not through VBA.

Can anybody help?

thanks

Ade
 
Partly answering my own question, the mousedown event seems to work ok even when mutliselect is chosen for the listbox.

Seems odd situation though!

Ade
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top