SHEETS (number of worksheets)

<< Click to Display Table of Contents >>

SHEETS (number of worksheets)

Syntax:

SHEETS([reference])

Description:

Returns the number of referenced worksheets (both visible and hidden sheets).

If the optional argument Reference is not specified, the function returns the number of worksheets in the current workbook.

Example:

A document contains 3 worksheets.

SHEET() returns 3.

SHEET(A1) returns 1, because of the reference to a cell in the current worksheet.

SHEET(Table1:Table2!A1) returns 2, because of the reference to cells in worksheet1 and worksheet2.

Compatibility notes:

Microsoft Excel supports this function only in version 2013 or later. In older versions, the function is unknown.

See also:

SHEET, SHEETNAME