Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ankur
 
Posts: n/a
Default count no of worksheet

is there any command to count the total no of worksheets in a file
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

ACtiveworkbook.Worksheets.Count

--
HTH

Bob Phillips

"Ankur" wrote in message
...
is there any command to count the total no of worksheets in a file



  #3   Report Post  
Ankur
 
Posts: n/a
Default

i am not able to do that can u please explain in detail......thanks for your
help

"Bob Phillips" wrote:

ACtiveworkbook.Worksheets.Count

--
HTH

Bob Phillips

"Ankur" wrote in message
...
is there any command to count the total no of worksheets in a file




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

This is VBA, so you need to go to the VB IDE (Alt-F11) and then either
- add it to a macro that you are writing
OR
- create a UDF that returns it if you want it in a worksheet function

Function NumSheets()
NumSheets = Application.Caller.Parent.Parent.Worksheets.Count
End Function


and add
=NumSheets()
in your worksheet

--
HTH

Bob Phillips

"Ankur" wrote in message
...
i am not able to do that can u please explain in detail......thanks for

your
help

"Bob Phillips" wrote:

ACtiveworkbook.Worksheets.Count

--
HTH

Bob Phillips

"Ankur" wrote in message
...
is there any command to count the total no of worksheets in a file






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
referencing another worksheet chartasap Excel Worksheet Functions 2 July 13th 05 01:58 PM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM


All times are GMT +1. The time now is 02:07 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"