View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_8_] Nigel[_8_] is offline
external usenet poster
 
Posts: 172
Default total no of worksheets in the workbook

Worksheets.Count will count visible and hidden sheets (both hidden and very
hidden) - is this the problem?

Cheers
Nigel

wrote in message
...
Hi

i am trying to find out the total no of worksheets in the
workbook...i have in total 4 worksheets... but somehow its
giving me incorrect value of 9...the total count instaead
of 4 is comign to be 9........

what could be the reason..
here is how i am getting it:

cntB = Workbooks(uuWkBkName).Worksheets.Count
cntB = ActiveWorkbook.Worksheets.Count

i have used this before and was never a problem..only
today its giving me this absurd error!

thanks in advance