ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multiple firing of macro from ListBox (https://www.excelbanter.com/excel-programming/318606-multiple-firing-macro-listbox.html)

SteveF

Multiple firing of macro from ListBox
 
I have a listbox (from Controls Toolbox) that has a macro assigned to
the click event. However when I click it the macro ends up running 3
times.

If I create a listbox from the Forms Toolbox and assign it to the same
macro it works fine- but for various reasons I would like to use the
Controls listbox.

Anybody got ideas on why the macro fires 3 times? Is there a property
somewhere I'm not aware of?


Sharad

Multiple firing of macro from ListBox
 

Well it shouldn't fire 3 times, it should fire it only once.
Unless in addition to the click event, you have same code in change
event and GotFocus event of the list box.

Or worksheet_change event: since the linked cell value will check when
you click on new value, worksheet_change event is fired.

Or something in your code itself ..

Sharad


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Harald Staff

Multiple firing of macro from ListBox
 
Hi

If the macro changes the listbox' listindex then that generates a click and
it will run itself.

HTH. Best wishes Harald

"SteveF" skrev i melding
oups.com...
I have a listbox (from Controls Toolbox) that has a macro assigned to
the click event. However when I click it the macro ends up running 3
times.

If I create a listbox from the Forms Toolbox and assign it to the same
macro it works fine- but for various reasons I would like to use the
Controls listbox.

Anybody got ideas on why the macro fires 3 times? Is there a property
somewhere I'm not aware of?





All times are GMT +1. The time now is 03:43 PM.

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