WORKSHEETSCOUNT

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
   Else
      WORKSHEETSCOUNT = Application.ActiveWorkbook.Worksheets.Count
   End If

End Function


You can use the built-in worksheet function SHEETS() in Excel 2013 to return the number of sheets in the active workbook.


Migration

In Power Utility Pack this function is called SHEETCOUNT


© 2018 Better Solutions Limited. All Rights Reserved. © 2018 Better Solutions Limited