ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Click Event - list box (https://www.excelbanter.com/excel-programming/384962-click-event-list-box.html)

kirkm[_6_]

Click Event - list box
 

I'm getting the click event firing as soon as a Form & List box open.

Stepping through my code I see the Click event happens immediately
after 'Private Sub List1_Enter()'

Is this an obvious way to avoid this somehow? I only want the click
event occurring after a click. (Which it does as well, but this
initial one stuffs everything up.)

Thanks - Kirk

OssieMac

Click Event - list box
 
Have you got both Enter and Click events? (ie. 'Private Sub List1_Enter()'
and 'Private Sub List1_Click()'.) Do you really need both?

I am assuming that you are opening the list box with code and if so you
could try putting in the following line of code 'Application.EnableEvents =
False' immediately before opening the list box and then
'Application.EnableEvents = True' Immediately after opening the list box and
see if it suppresses the call to the enter event.

Regards,

OssieMac

"kirkm" wrote:


I'm getting the click event firing as soon as a Form & List box open.

Stepping through my code I see the Click event happens immediately
after 'Private Sub List1_Enter()'

Is this an obvious way to avoid this somehow? I only want the click
event occurring after a click. (Which it does as well, but this
initial one stuffs everything up.)

Thanks - Kirk



All times are GMT +1. The time now is 05:39 PM.

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