Application.WorkbookNewSheet Event (Excel)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

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

expression .WorkbookNewSheet(Wb, Sh)

expression A variable that represents an Application object.

Parameters

Name

Required/Optional

Data Type

Description

Wb

Required

Workbook

The workbook.

Sh

Required

Object

The new sheet.

Return Value

Nothing

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

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