Saturday, April 4, 2009

How many sheets do I have in my workbook?

Saw this question here:
Great job as usual.  I'm sorry that I did not make myself clear.  I
have several workbooks that contain several sheets each and while I do
have tabs at the bottom, I wanted to see a number perhaphs at the
bottom representing how many sheets the workbook had upon opening it.
If that's not possible, that's okay.  I really appreciate the
shortcut.  It's going to come in very handy. Thanks
The simple answer is to create a UDF, which reads:
Public Function NumSheets()
NumSheets = ThisWorkbook.Sheets.Count
End Function

Then, in a cell, type =NumSheets()

Sometimes it is a trivial answer.

0 comments: