Application.EnableEvents = FALSE

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
962
Office Version
  1. 2010
Platform
  1. Windows
Want to understand: what Application.EnableEvents = FALSE does in the code. 1 of my Excel workbook contains multiple worksheets. In 4 worksheets, there are codes & all functioning properly. In a new inserted worksheet in the same Excel workbook, a code is to be pasted which contains Application.EnableEvents = FALSE.

Thanks for having a look at it.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Ron Coderre

MrExcel MVP
Joined
Jan 14, 2009
Messages
2,316
Let's say you have on_change event code in a worksheet and your code will change a cell value.
That would trigger the on_change event and begin an endless loop.
The Application.EnableEvents = False line of code turns off EnableEvents, preventing Excel from sensing the change.
After the code makes the change...turn EnableEvents back on.
 

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
962
Office Version
  1. 2010
Platform
  1. Windows
What I am trying to figure out is: having Application.EnableEvents = False line in a code that would be pasted in the worksheet module of a worksheet tab named 'D3' would hamper functionality of other codes in the other 4 worksheets of the same Excel workbook or not? Note: The codes in these 4 worksheets are pasted in the worksheet module.

Secondly, writing another line
With Sheets("D3") in the code does what precisely?
 
Last edited:

Formular

New Member
Joined
Sep 27, 2014
Messages
23
Application.EnableEvents = False
will block any event handling on any worksheet until you turn it back on with
Application.EnableEvents = True
It's strongly recommended to do at the end of the same Sub.
 

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
962
Office Version
  1. 2010
Platform
  1. Windows
Okay got it. Writing a line in a code: With Sheets("D3") does what precisely?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,629
Messages
5,838,454
Members
430,549
Latest member
jayjay2022

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top