Skip to content

Latest commit

 

History

History
52 lines (32 loc) · 1.03 KB

Excel.Application.WorkbookNewSheet.md

File metadata and controls

52 lines (32 loc) · 1.03 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.WorkbookNewSheet event (Excel)
vbaxl10.chm504087
vbaxl10.chm504087
Excel.Application.WorkbookNewSheet
5190254f-b7f4-10e5-41f5-704b1466ff68
04/05/2019
medium

Application.WorkbookNewSheet event (Excel)

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

Name Required/Optional Data type Description
Wb Required Workbook The workbook.
Sh Required Object The new sheet.

Return value

Nothing

Example

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

[!includeSupport and feedback]