Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions User Defined > SHEETCOUNT< Previous | Next > 

 

SHEETCOUNT(bIncludeChartSheets)

 
 

Returns the name of the worksheet in a given position.

 

 
bIncludeChartSheetsWhether to include chart sheets in the total.
 

 

REMARKS

 
 
  • ??

     

     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    Option Explicit

    Public Function SHEETCOUNT(Optional ByVal bIncludeChartSheets As Boolean = True) As Integer

       Call Application.Volatile(True)

       If bIncludeChartSheets = True Then
          SHEETCOUNT = Application.ActiveWorkbook.Sheets.Count
       Else
          SHEETCOUNT = Application.ActiveWorkbook.Worksheets.Count
       End If

    End Function
       

     

    Example

     


     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.< Previous | Top | Next >