![]() |
Counting the number of Worksheets in a Workbook
I want to show how many sheets I have in a workbook using a formula. The
number changes everyday. What do I use, or can I even do this? |
Counting the number of Worksheets in a Workbook
This user defined function will do it...
Public Function WksCount() As Integer WksCount = Application.Worksheets.Count End Function HTH, -- Gary Brown If this post was helpful, please click the ''Yes'' button next to ''Was this Post Helpfull to you?''. "Bill from Holland Michigan" wrote: I want to show how many sheets I have in a workbook using a formula. The number changes everyday. What do I use, or can I even do this? |
Counting the number of Worksheets in a Workbook
Gary L Brown wrote:
This user defined function will do it... Public Function WksCount() As Integer WksCount = Application.Worksheets.Count End Function HTH, -- Gary Brown If any of your sheets are not worksheets (eg chart sheets, xl4macro sheets) then you should use... Public Function ShtCount() As Integer ShtCount = Application.Sheets.Count End Function Ken Johnson |
All times are GMT +1. The time now is 07:25 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com