Share via


SheetCalculate Event [Excel 2003 VBA Language Reference]

Occurs after any worksheet is recalculated or after any changed data is plotted on a chart.

Private Subobject**_SheetCalculate(ByValShAs Object)**

objectApplication or Workbook. For more information about using events with the Application object, see Using Events with the Application Object .

Sh The sheet. Can be a Chart or Worksheet object.

Example

This example sorts the range A1:A100 on worksheet one when any sheet in the workbook is calculated.

Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
    With Worksheets(1)
        .Range("a1:a100").Sort Key1:=.Range("a1")
    End With
End Sub

Applies to | Application Object | Workbook Object

See Also | Calculate Method