Worksheets Collection Object

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.


Aa191143.parchild(en-us,office.10).gifWorksheets
Aa191143.space(en-us,office.10).gifAa191143.parchild(en-us,office.10).gifWorksheet

A collection of all the Worksheet objects in the workbook. Each Worksheet object represents a worksheet.

Using the Worksheets Collection Object

Use the Worksheets property of Spreadsheet or Workbook object to return the Worksheets collection.

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

  Spreadsheet1.Worksheets.Add _
        Spreadsheet1.Worksheets(1), ,2

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

  Spreadsheet1.Worksheets(1).Visible = False

The Worksheet object is also a member of the Sheets collection.