Chapter 10. Working with Worksheets

Add a Sheet

To add a new sheet to a workbook, you can use the Add method with the Sheets object. You can use this method to add a worksheet, chart sheet, or macro sheet. The Add method has four optional parameters that specify where in the workbook to place the sheet, the number of sheets to add, and the type of sheet to create. The following is the syntax for the Add method:

expression.Add(Before, After, Count, Type)

Use the expression portion of the statement to identify the workbook to which you want to add sheets. Use the Before parameter to tell VBA the sheet before which you want to place the new sheet, or use the After parameter to tell VBA the sheet after which you want to place the new sheet. You can use ...

Get Excel® Programming: Your visual blueprint™ for creating interactive spreadsheets 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.