Wauvel

Excel like a finance pro.

← The library

VBA · Events

Application.EnableEvents

Turns event handling off so a Change event that writes to the sheet does not trigger itself forever.

OccasionalDifficulty 1400 · Advanced
Practice · 2 questions →

When to use it

Application.EnableEvents = False stops event procedures from firing. Essential inside a Change event that writes to the sheet, and always restore it afterwards.

The code

Code
Application.EnableEvents = False
... write cells ...
Application.EnableEvents = True

Worked examples

  • Safe write in an event

    Application.EnableEvents = False Range("C1").Value = Now Application.EnableEvents = True Writes a timestamp without retriggering Worksheet_Change

    The standard bracket.

  • Restore on error

    On Error GoTo Done Application.EnableEvents = False ... Done: Application.EnableEvents = True Restores events even if an error occurs

    Always restore in the handler.

  • Check the state

    ?Application.EnableEvents ' in the Immediate window Shows whether events are currently off

    Diagnose "my events stopped working".

Worth knowing

  • If events seem dead, a crashed macro left EnableEvents False; set it True in the Immediate window.
  • It is application-wide, affecting every open workbook.
  • Pair with ScreenUpdating and Calculation in the same bracket.

Where it goes wrong

  • Forgetting to restore it disables every event in every workbook until Excel restarts.
  • Does not stop UserForm control events.

Related

Learn the moves here — or let Wauvel run them on your numbers.

Meet your AI CFO →

One CFO-grade Excel tip a week

A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.