Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Function for counting Worksheets?

I need to know a function that i can enter into a cell that will give me the
total number of worksheets i have in a specific Workbook.

it will serve as an invoice number because i create a new sheet for each
invoice i have.

thank you.
--
Jon Robershaw
Wardell Builders, Inc
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Function for counting Worksheets?

Hi,

Alt +F11 to open VB editor. Right click 'This Workbook' and insert module
and paste the code below in. Call with

=numsheets()

Function numsheets()
numsheets = Worksheets.Count
End Function

Mike

"JonWardellBuilders" wrote:

I need to know a function that i can enter into a cell that will give me the
total number of worksheets i have in a specific Workbook.

it will serve as an invoice number because i create a new sheet for each
invoice i have.

thank you.
--
Jon Robershaw
Wardell Builders, Inc

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Function for counting Worksheets?

Hi,

1. In the same cell in each sheet enter something (anything), say you enter
the date into cell A1 on each invoice, then

=COUNTA(Sheet1:Sheet300!A1)

Where Sheet1 is the first sheet in the workbook and Sheet300 is the last
sheet (left to right) in the spreadsheet. When you add a new sheet, insert
it between the first and last sheet. If necessary make Sheet300 a dummy with
nothing in it.

If this helps, please click the Yes button.
--
Thanks,
Shane Devenshire


"JonWardellBuilders" wrote:

I need to know a function that i can enter into a cell that will give me the
total number of worksheets i have in a specific Workbook.

it will serve as an invoice number because i create a new sheet for each
invoice i have.

thank you.
--
Jon Robershaw
Wardell Builders, Inc

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
counting data across worksheets franki_85[_2_] Excel Worksheet Functions 4 November 21st 07 04:21 PM
counting data across worksheets franki_85[_2_] Excel Discussion (Misc queries) 5 November 21st 07 02:19 PM
counting function but not double counting duplicates JRD Excel Worksheet Functions 2 November 7th 07 06:43 PM
Counting Worksheets, Second Verse Janie Excel Worksheet Functions 0 October 22nd 06 07:46 PM
Help with counting across worksheets Biff Excel Discussion (Misc queries) 4 April 12th 05 04:16 AM


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