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 |
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 |
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 |
All times are GMT +1. The time now is 07:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com