Returns the number of sheets
'bIncludeChartSheets - Whether to include chart sheets in the total.
Public Function WORKSHEETSCOUNT(Optional ByVal bIncludeChartSheets As Boolean = True) As Integer
If bIncludeChartSheets = True Then
WORKSHEETSCOUNT = Application.ActiveWorkbook.Sheets.Count
WORKSHEETSCOUNT = Application.ActiveWorkbook.Worksheets.Count
You can use the built-in worksheet function SHEETS() in Excel 2013 to return the number of sheets in the active workbook.
In Power Utility Pack this function is called SHEETCOUNT
© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext