Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default total no of worksheets in the workbook

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default total no of worksheets in the workbook

ok..yah maybe u r rite...
i wasnt aware that worksheets can also be hidden.. i tried
to findout the hidden sheets....couldnt find the way to
see hidden sheets

hwo do i see the hidden worksheets?

thanks a lot!
-----Original Message-----
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



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default total no of worksheets in the workbook

To help you identify the sheets try something like this


Sub ddddd()
Dim wS As Worksheet
For Each wS In Worksheets
wS.Visible = xlSheetVisible
Debug.Print wS.Name
Next

End Su

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default total no of worksheets in the workbook

i figured it out..
i need to go to format--sheet!

thanks
-----Original Message-----
ok..yah maybe u r rite...
i wasnt aware that worksheets can also be hidden.. i

tried
to findout the hidden sheets....couldnt find the way to
see hidden sheets

hwo do i see the hidden worksheets?

thanks a lot!
-----Original Message-----
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



.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto copy total from one workbook to another workbook hugrl Excel Worksheet Functions 1 February 14th 09 11:57 PM
How many total worksheets can be added to a workbook? Alberto Excel Discussion (Misc queries) 4 November 23rd 08 06:34 AM
Sum total from other worksheets Natalie Excel Worksheet Functions 5 May 22nd 06 07:02 PM
how do I get a total for all worksheets in my workbook? Aileen Hewat Excel Discussion (Misc queries) 2 June 4th 05 08:23 AM
Adding Data Using Multiple Worksheets to Total into a Grand Total Lillie Excel Worksheet Functions 1 April 19th 05 08:34 PM


All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"