Occurs when the chart, worksheet, or workbook is deactivated.
Private Sub object_Deactivate()
object Chart, Workbook, or Worksheet. For information about using events with the Chart object, see Using Events with the Chart Object.
Example
This example arranges all open windows when the workbook is deactivated.
Private Sub Workbook_Deactivate()
Application.Windows.Arrange xlArrangeStyleTiled
End Sub