Disable Userform Events

  • Thread starter Thread starter Ryan H
  • Start date Start date
R

Ryan H

Is there a way to keep userform events from firing? I don't want my
Combobox_Change Events firing when I click my command button.
 
Ryan,

An easy way to control execution of code is to use a global boolean, and check that value for a
state:

Public boolUFEventsDisabled As Boolean

Set it to true using some event, like the form load, or a button click:

boolUFEventsDisabled = True


Then at the top of all events, use

If boolUFEventsDisabled Then Exit Sub

and have some way to re-enable it...

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top