Count total sheets using a formula
You can use this built-in function to get the total number of sheets in your workbook.
=SHEETS()
Simply enter the =SHEETS() function in any cell and press the "Enter" key. Do not assign any argument (or parameter) to the function. It will "return" the total number of sheets in the Excel file (or workbook), including hidden sheets.
Count sheets in Excel using VBA
Write this code in a module and press F5.
Sub sheetCount()
Debug.Print (Sheets.Count) ' Press Ctrl + g to open the debug window and see the output.
End Sub