Change Event

Applies To

Worksheet object.

Description

Occurs when cells on the worksheet are changed by the user or by an external link.

Syntax

Private Sub Worksheet_Change(ByVal Target As Range)

Target The changed range. Can be more than one cell.

Remarks

This event doesn't occur when cells change during a recalculation. Use the Calculate event to trap a sheet recalculation.

Deleting cells doesn't trigger this event.

See Also

Calculate event, SheetChange event.

Example

This example changes the color of changed cells to blue.

Private Sub Worksheet_Change(ByVal Target as Range)
    Target.Font.ColorIndex = 5
End Sub