Link to home
Start Free TrialLog in
Avatar of Rayne
RayneFlag for United States of America

asked on

Combobox Event to Trigger Macro

Hello All,

There is form that has a drop down combobox….on selecting an option out of the list for example…if I start typing “w”, then it selects WER but what happens it that it calls the macro at the same time , which make things longer to wait
Once I type in “W” and it selects “Wer”, then the macro should be called and it does it stuff…how to do that?
What’s now happening is when I type in “W”, it selects “WER” and calls the macro and the users has to wait while he was not able to properly  see what selection was made by him. The moment he types in only one letter (like W), it triggers the macro…
What needs to happen …is user should be able to type in a letter or string in the combobox and the combobox will then fill out “Wer” and then on that correct select, then the macro will be called

Am I using the wrong combobox code (combobox on change ) to call the macro?
ComboBoxEvent.xlsm
SOLUTION
Avatar of Jornak
Jornak
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steve
The BeforeUpdate event can be used.
This allows for validation to be performed, giving better control of the combobox.
Avatar of Rayne

ASKER

Hello The_Barman
Can you explain that with a snippet of code (before event)..?
I do get the after event thing...
Avatar of Rayne

ASKER

Also, when I use the after event  - once I select the value, I have to close the form before the macro gets called – is there a way to set it so that once I click or select option, it close the form itself and then calls the macro

So can it be done so that first time write “W” and the combo box fills out “Wer” and then I click on that option , it closed out of the form and then calls the macro…
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rayne

ASKER

Awesome TheBarman, yes a snippet always explains better.....


Imnorie - regarding your question - Do you want the macro to be called only when something from the list is selected from the combobox?
Yes, that would be ideal - if you can explain how to do - so only when users select a value from the list, only then the macro gets called - so that users don't have to close the form at all - it will (close by itself) when the selection is made and then the macro gets called

I will reopen this question - so that I can better split the points for the expert's suggestions
Avatar of Rayne

ASKER

Imnorie - let me know if [Do you want the macro to be called only when something from the list is selected from the combobox?] is possible - I will open up another question for this

Thanks