When a worksheet is deactivated in Excel, there are a few things that happen:
Deactivateevent is triggered.
SheetDeactivateevent is triggered.
Application.ActiveSheetproperties are updated to reflect the new active workbook and worksheet.
Example: How to Trigger an Event when a Worksheet is Deactivated in Excel
Private Sub Worksheet_Deactivate() 'Do something when this worksheet is deactivated End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) 'Do something when any worksheet is deactivated End Sub
"Active" events are triggered when a sheet or workbook becomes active. "Deactivate" events are triggered when a sheet or workbook becomes inactive. In other words, "Active" events happen before "Deactivate" events.