Results 1 to 5 of 5
  • Thread Tools
  1. 2 Star Lounger
    Join Date
    Sep 2001
    Location
    California
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count Worksheets (97 & 2000)

    How can I easily find out how many worksheets are in a workbook?
    Thanks,
    Caroline in lala-land

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. Super Moderator
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,507
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Count Worksheets (97 & 2000)

    Open the VBE and in the Immediates window enter

    ?ThisWorkbook.Worksheets.Count

    and press enter.

    I was looking for a formula, but =COUNTBLANK() isn't 3D.
    -John ... I float in liquid gardens
    [acronym title="Gday mate!"][/acronym] [acronym title="What up Dude?"][/acronym] UTC -7ąDS

  4. Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count Worksheets (97 & 2000)

    The following User Defined Function will return the number of worksheets in the activeworkbook (does not include other kinds of sheets like chart sheets). However, Excel does not consider inserting a new worksheet a recalculate event. Therefore, the count will not update after inserting a new worksheet until some other change is made that causes a recalculate event.


    <pre>Public Function NumSheets() As Integer
    Application.Volatile
    NumSheets = ActiveWorkbook.Worksheets.Count
    End Function
    </pre>

    Legare Coleman

  5. 2 Star Lounger
    Join Date
    Jan 2001
    Location
    Perth, Western Australia, Australia
    Posts
    189
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count Worksheets (97 & 2000)

    This thread may be of use..

  6. WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,851
    Thanks
    0
    Thanked 77 Times in 73 Posts

    Re: Count Worksheets (97 & 2000)

    Just as an alternative to the other suggestions, choose Insert-Name-Define, choose a name (e.g. SheetCount) and in the refers to box type:
    =GET.WORKBOOK(4)
    then in any cell in your workbook you can use =sheetcount.
    Note that this has the same drawback that Legare mentioned with his VBA solution.
    Regards,
    Rory
    Microsoft MVP - Excel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •