Skip to main content

Workbook.Sheets property

Table of contents
  1. Syntax
  2. Remarks
  3. Example

Returns a Sheets collection that represents all the sheets in the specified workbook. Read-only Sheets object.

Syntax

expression.Sheets

expression An expression that returns a Workbook object.

Remarks

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

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>