Deny Worksheet_Change event

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
3,812
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a workbook open event that defaults values of certain cells in a worksheet.
As it's doing so, it is triggering the worksheet_change event (triggers code with a specific user cell entry) with each cell that is defaulted.

Is there a way to prevent the worksheet change event from occuring during this process?
 

Some videos you may like

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
36,068
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2010
Platform
  1. Windows
  2. MacOS
Use:
Code:
Application.Enableevents = False
' code that changes cells
Application.Enableevents = True
in your Open event.

Oh and ideally, the code to re-enable events would be in an error handler to ensure it always gets called!
 

DanD

Board Regular
Joined
Dec 23, 2008
Messages
124
Application.enableevents = False/True

Will turn events, such as worksheet_change on and off

Must learn to type faster!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,604
Messages
5,597,128
Members
414,126
Latest member
jellevansoelen

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