+ Reply to Thread
Results 1 to 2 of 2

Thread: Command to count number of worksheets in a workbook?

  1. #1
    Saul Fowler
    Guest

    Command to count number of worksheets in a workbook?

    I am setting up a workbook to contain information on expenditure on events.
    For each event there will be a worksheet detailing expenditure, which will
    also act as a form for the expenditure to be authorised. The number of
    worksheets will vary depending on the number of events held each month (i.e.
    if there are 10 events in the month there will be 10 corresponding
    worksheets). The data on these worksheets will be transferred onto a summary
    sheet - one row per event. Rather than estimating the number of events per
    month (and therefore the number of worksheets) and hardcoding the formulas
    into the summary sheet, is there a command within excel that can count the
    number of worksheets in the workbook so I can use the result to then populate
    the summary page?

  2. #2
    Gary''s Student
    Guest

    RE: Command to count number of worksheets in a workbook?

    Try this tiny UDF:

    Function worksheetcount()
    worksheetcount = Worksheets.Count
    End Function
    --
    Gary's Student


    "Saul Fowler" wrote:

    > I am setting up a workbook to contain information on expenditure on events.
    > For each event there will be a worksheet detailing expenditure, which will
    > also act as a form for the expenditure to be authorised. The number of
    > worksheets will vary depending on the number of events held each month (i.e.
    > if there are 10 events in the month there will be 10 corresponding
    > worksheets). The data on these worksheets will be transferred onto a summary
    > sheet - one row per event. Rather than estimating the number of events per
    > month (and therefore the number of worksheets) and hardcoding the formulas
    > into the summary sheet, is there a command within excel that can count the
    > number of worksheets in the workbook so I can use the result to then populate
    > the summary page?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0