• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to count Worksheets in Excel File.

az4khan

New Member
I have created many Worksheets in my Excel and I'm totally unaware how many are actually there. Is there any option to know that how much worksheets has this file?
 
Az4khan

Firstly, Welcome to the Chandoo.org Forums


Goto VBA, Alt F11


If you can see an Window titled Immediate

Click in it and type in


? worksheets.Count


? charts.Count


If you can't see an Immediate Window Ctrl G


Alt F11 back to Excel
 
There is a post at this site: http://pubs.logicalexpressions.com/pub0009/lpmarticle.asp?id=315 that provides VBA code for obtaining the number of worksheets and each worksheets name. Scroll down to "Example 4" for the code.


Getting the worksheet's name could be really handy for switching between worksheets using the Address function.
 
Back
Top