I have a Worksheet_Change
event where if a cell in column F changes, a message pops up asking if the user wants to change the cell text.
Now, I have VBA code that inserts new rows and, therefore, makes changes in column F, but I don't want the message to pop up or this code to be called at all.
Is there a way to distinguish between a user and Excel itself (VBA) making a change on the worksheet?
Just insert the line
Application.EnableEvents = False
before executing your code and then (at the end) set
Application.EnableEvents = True
again to make sure that Excel reacts to Events
on the worksheet again.
For more information read this: https://msdn.microsoft.com/en-us/library/office/ff821508.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With