Remarks

The Worksheet object is also a member of the collection. The Sheets collection contains all the sheets in the workbook (both chart sheets and worksheets).

Example

Use the property to return the Worksheets collection.The following example moves all the worksheets to the end of the workbook.

Visual Basic for Applications
Worksheets.Move After:=Sheets(Sheets.Count)

Use the method to create a new worksheet and add it to the collection. The following example adds two new worksheets before sheet one of the active workbook.

Visual Basic for Applications
Worksheets.Add Count:=2, Before:=Sheets(1)

Use Worksheets(), where is the worksheet index number or name, to return a single Worksheetobject. The following example hides worksheet one in the active workbook.

Visual Basic for Applications
Worksheets(1).Visible = False
worksheet Worksheets Collection Worksheets Collection Object

See also:

index index