How to Count Number of Worksheets in Excel
Written by
Reviewed by
Last updated on March 20, 2024
This tutorial demonstrates how to count the number of worksheets in an Excel file.
Count Number of Worksheets
The easiest way to count the number of worksheets in your workbook is to use the SHEETS Function. Say your Excel file has six worksheets.
In any cell on any of the sheets, enter the formula:
=SHEETS()
As you can see, this function without arguments returns the total number of sheets in the current workbook (including hidden sheets).
Tips:
- See how to view a list of these sheets.
- If you add a new sheet, press F9 to update the count. It won’t automatically change.
- But, if you delete a sheet, the formula does recalculate automatically.
Count Sheets with VBA
If you want to count the number of sheets using VBA, you can use this Macro:
Public Sub CountMySheets()
MsgBox Application.Sheets.Count
End Sub