This documentation is archived and is not being maintained.

Application.WorkbookNewSheet Event

Office 2007
Occurs when a new sheet is created in any open workbook.

Syntax

expression.WorkbookNewSheet(Wb, Sh)

expression   A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
WbRequiredWorkbookThe workbook.
ShRequiredObjectThe new sheet.

Return Value
Nothing

Example

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

Visual Basic for Applications
Private Sub App_WorkbookNewSheet(ByVal Wb As Workbook, _
        ByVal Sh As Object)
    Sh.Move After:=Wb.Sheets(Wb.Sheets.Count)
End Sub



Show: