Excel2000: Avoiding loop in Worksheet_Change event

A

Arvi Laanemets

Hi

I have a Change Event for a worksheet, where 2 cells on this worksheet are
checked, and some actions are taken, whenever some of them changes. By
certain conditions, one of actions will be changing the entry in one of
checked cells - which will fire the same Change event again, etc.

Is there a way to 'switch the Change Event firing off' temporarily. I mean,
that when the condition for changing this cell value is met, some code row
has to switch executing of further Change events off, after that the change
to cell is made, then further change events are turned on again, and then
rest of code in current Change event is processed.
 
G

Gary''s Student

Application.EnableEvents=False
do your logic
Application.EnableEvents=True
 

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

Top