use this code/function:
Function sheet_count() As Integer
sheet_count = ThisWorkbook.Sheets.Count
End Function
press ALT+F11 to open Microsoft Visual Basic window
click Insert->Module
paste the code there
then in any cell insert:
=sheet_count()
ATTENTION: the function ALL sheets in the workbook, including chart
sheets and hidden sheets
pls click YES if this post was helpful