View Single Post
  #8   Report Post  
Dave Peterson
 
Posts: n/a
Default

I'm not sure if it's important, but this version will calculate the number of
worksheets in the workbook with the formula.


Option Explicit
Function WSNum()
WSNum = Application.Caller.Parent.Parent.Worksheets.Count
End Function

Application.caller is the cell containing the formula.
its parent is the worksheet.
the worksheet's parent is the workbook.

If you open two workbooks (each with a different number of worksheets in them)
and use window|arrange|horizontal.

You should be able to notice the difference.

Vincdc wrote:

Hello:
Is there any function or other method to count the number of worksheets in a
workbook? I have a workbook which includes dozens of worksheets (each for one
client) and I would like to know the total number of clients.
Thanks in advance!


--

Dave Peterson