SHEETS (number of worksheets)

<< Click to Display Table of Contents >>

SHEETS (number of worksheets)

Syntax:

SHEETS([Reference])

Description:

This 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. The function is unknown in older versions.

See also:

SHEET, SHEETNAME