ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Return the number of Sheets in a Workbook (https://www.excelbanter.com/excel-programming/282809-return-number-sheets-workbook.html)

gminor7[_3_]

Return the number of Sheets in a Workbook
 

Is there a way in VB to return the number of sheets in a workbook

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


Jos Vens

Return the number of Sheets in a Workbook
 
Yes there is:

ActiveWorkbook.Sheets.Count

Regards,
Jos Vens

"gminor7" schreef in bericht
...

Is there a way in VB to return the number of sheets in a workbook?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/




gminor7[_4_]

Return the number of Sheets in a Workbook
 

Thanks

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


Bob Phillips[_6_]

Return the number of Sheets in a Workbook
 
activeworkbook.worksheets.Count

counts just the worksheets as opposed to all sheets, and

activeworkbook.charts.Count

counts the number of charts

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Jos Vens" wrote in message
...
Yes there is:

ActiveWorkbook.Sheets.Count

Regards,
Jos Vens

"gminor7" schreef in bericht
...

Is there a way in VB to return the number of sheets in a workbook?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/







All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com