Workbook_SheetChange triggered to many times

D

Devvy D

Hi there!

When user enters some text in a cell, I use macros to validate.
If there are some incorrect data I want to correct this
programmatically. So I use the SheetChange event.

The problem is that when I correct what the user entered, the event
is fired once again, and then again and again and again... I think you
understand the problem...

How can I work around this problem, is it for example possible to
temporarily disable the event?

Best Regards

L-E
 
D

Dave Peterson

Before you write to the cell, tell excel to stop looking for changes.


application.enableevents = false
'your code here
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