Share via


NewSheet Event [Excel 2003 VBA Language Reference]

Occurs when a new sheet is created in the workbook.

Private Sub Workbook_NewSheet(ByValShAs Object)

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

Example

This example moves new sheets to the end of the workbook.

Private Sub Workbook_NewSheet(ByVal Sh as Object)
    Sh.Move After:= Sheets(Sheets.Count)
End Sub

Applies to | Workbook Object

See Also | WorkbookNewSheet Event