(1), open the Tools menu, select the macro Visual Basic Editor command, as shown in the figure:
(2), in the open window select the "Insert" → "module" command, as shown in the figure:
(3) Enter the following content, as shown in the picture:
Sub Sheetcount ()
Dim Num as Integer
Sheets (1). Select
Cells (1,1) =num
(4), run the macro, the number in the A1 cell of the first worksheet in the workbook is the number of worksheets.
(1) Press the "CTRL+F3" key combination, open the Define Name dialog box, define an X, enter "=get.workbook (4)" At the reference location, and then click OK, as shown in the picture:
(2) Enter "=x" in any cell, and the result is the number of worksheets.