disable selection change vba while running other code

andrewb90

Well-known Member
Joined
Dec 16, 2009
Messages
1,067
Hello all,

I notice that my code is always running through my various selection change codes when I run a macro, is there any way I can have those bypassed while macros are running? I feel that would speed things up.
 

gallen

Well-known Member
Joined
Jun 27, 2011
Messages
1,945
You need to disable events when running then enable.

Caveat: ensure you use error handling and re-enable events if errors occur

Use this code and set to true to re-enable.
Code:
Application.EnableEvents = False
 

Forum statistics

Threads
1,082,629
Messages
5,366,645
Members
400,908
Latest member
currong

Some videos you may like

This Week's Hot Topics

Top