How do I determine how many worksheets a workbook has at a glance

G

Guest

Received an inquiry by a supervisor who would like to know how many
worksheets a workbook has without actually paging through the workbook to
determine how many there are. Is there a way it can be shown at a glance how
many worksheets a workbook has?
 
C

cturner

Received an inquiry by a supervisor who would like to know how many
worksheets a workbook has without actually paging through the workbook to
determine how many there are. Is there a way it can be shown at a glance how
many worksheets a workbook has?

If you click on FILE / PROPERTIES, it will list the worksheets on the
CONTENTS tab.
 
G

Guest

Open CB editor ALT + F11 insert a new module and paste this in and maybe even
give your supervisor a nice button to press that runs this macro.

Sub makemybossleavemealone()
Dim sht As Worksheet
For Each sht In Sheets
X = X + 1
Next sht
MsgBox ("There are " & X & " Worksheets in this workbook")

End Sub

Mike
 
G

Gord Dibben

dm

Sub sheets_num()
MsgBox ActiveWorkbook.Sheets.Count & " sheets in workbook"
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top