Name
worksheets
.Add(Before, After, Count, Type
)
Synopsis
Creates one or more worksheets. If you create a single worksheet, it is the active sheet. If you create more than one worksheet, the last sheet created is the active sheet.
Argument |
Settings |
---|---|
|
Specifies an existing worksheet if you want to place the new worksheet before that sheet. |
|
Specifies an existing worksheet if you want to place the new worksheet after that sheet. |
|
Specifies the number of sheets to be added if you want to create more than one sheet. |
|
Use |
The following code creates two worksheets after the WombatBattingAverages worksheet:
ActiveWorkbook.Sheets.Add After:=Worksheets("WombatBattingAverages"), Count:=2
Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.