Excel 5.0 Events

The versions of Excel before Excel 97 also supported events although these events had to be explicitely defined.For compatibility reasons these methods are still supported although they should not be used now.

OnSheetActivate

This event runs whenever the user switches to a sheet in the workbook.You can set this event for any of the following objects:

OnEntry

This event runs when a user enters some data onto a worksheet.

Application.OnEntry = "Macro_Name" Workbook.OnEntry = "Macro_Name"

This event occurs after the user enters the data and presses Enter or selects another cell.The event will not occur if the user selects (Edit > Cut), (Edit > Paste) or if another procedure changes the contents of the cells.These have been replaced with the following events:

Application.SheetChange Workbook.SheetChange Worksheet.Change

OnData

This runs when new data arrives from an application other than Excel.

Application.OnData = "Macro_Name" Workbook.OnData = "Macro_Name"

This property is also available from some other objects that handle the arrival of data linked through DDE, object linking or embedding.The OnData event does not run if it is linked to another running instance of Excel.These have been replaced with the following events: