Avatar of Rayne
Rayne
Flag 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
Microsoft OfficeMicrosoft Excel

Avatar of undefined
Last Comment
Rayne

8/22/2022 - Mon
SOLUTION
Jornak

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Steve

The BeforeUpdate event can be used.
This allows for validation to be performed, giving better control of the combobox.
Rayne

ASKER
Hello The_Barman
Can you explain that with a snippet of code (before event)..?
I do get the after event thing...
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…
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
SOLUTION
Norie

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
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
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