Returns the number of sheets in a reference.

reference(Optional) The formula reference.

* If "reference" is not provided, then the total number of sheets in the workbook is returned.
* This function includes all worksheets (visible, hidden, very hidden, chart, dialog sheets, macro sheets).
* This function cannot be called from VBA.
* If "reference" is not valid, then #REF is returned.
* You can use the INFO function to return the text string returning useful information about the environment.
* You can use the SHEET function to return the sheet number of the referenced sheet.
* This function was added in Excel 2013.
* For the Microsoft documentation refer to

1=SHEETS() = 5
2=SHEETS(Sheet1!A1) = 1
3=SHEETS(Sheet1:Sheet1!A1) = 1
4=SHEETS(Sheet1:Sheet2!A1) = 2
5=SHEETS(Sheet3:Sheet4!A1) = 2
6=SHEETS(Sheet1:Sheet4!A1) = 4
7=SHEETS(Sheet1:Sheet5!A1) = 5

1 - The total number of worksheets in the active workbook is returned.

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top