How to Count the Number of Sheets of a Workbook?


Microsoft Excel is a robust spreadsheet programme that offers a variety of capabilities to effectively handle and analyse data. Knowing the total number of sheets provided can be helpful when working with complicated workbooks that have numerous sheets. Accurately numbering the sheets in your Excel workbook is a vital skill that can increase your productivity, whether you're organising data, keeping track of information, or performing financial analysis.

We'll walk you through each step of this tutorial's counting the number of sheets in an Excel workbook. We will examine numerous approaches that can be used, taking into account Excel versions 2010, 2013, 2016, 2019, and 365. This article will provide you the skills you need, whether you're a novice or an expert user, to quickly identify how many sheets are in your workbook.

Count the Number of Sheets of a Workbook

Here, we will first create a VBA module and then run it to complete the task. So let us see a simple process to know how you can count the number of sheets in a workbook in Excel.

Step 1

Consider any Excel workbook where you have multiple worksheets.

First, right-click on the sheet name and select View Code to open the VBA application.

Right click > View code.

Step 2

Then click on Insert and select Module, then copy the below code into the textbox.

Insert > Module > Copy.

Code

Public Sub CountWorkSheets()
MsgBox "The total number sheets of this workbook: " & Application.Sheets.Count
End Sub

Step 3

Then save the sheet as a macro-enabled template and click F5 to display the number of sheets.

Note

Another simple way is to click on an empty cell and enter the formula as =SHEETS().

Conclusion

In this tutorial, we have used a simple example to demonstrate how you can count the number of sheets in a workbook in Excel to highlight a particular set of data.

Updated on: 21-Aug-2023

84 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements