Sheets Property

Microsoft Excel Visual Basic

Returns a Sheets collection that represents all the sheets in the active workbook, for an Application object. Returns a Sheets collection that represents all the sheets in the specified workbook, for a Workbook object. Read-only Sheets object.

Remarks

For information about returning a single member of a collection, see Returning an Object from a Collection.

Using this property without an object qualifier is equivalent to using ActiveWorkbook.Sheets.

Example

This example creates a new worksheet and then places a list of the active workbook's sheet names in the first column.

Set newSheet = Sheets.Add(Type:=xlWorksheet)
For i = 1 To Sheets.Count
    newSheet.Cells(i, 1).Value = Sheets(i).Name
Next i