Stop Worksheet Activate code running in Excel

As you’re building together your workbook, you might be in a situation where you want a worksheet’s activate code (or any other worksheet code for that matter) to run in some cases but not others. For example, if you’re navigating from the main menu page you want it to run, but if you’re just briefly visiting the sheet to update something in the middle of another module then maybe you don’t.

 

Use the below to switch it off in the relevant places, and ensure you reset it back to True before exiting the sub.

 

Application.EnableEvents = False

Leave a Reply

Your e-mail address will not be published. Required fields are marked *