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

 

SHEETNAME(iSheetNo)

 
 

Returns the name of the worksheet in a given position.

 

 
iSheetNoThe number of the worksheet you want the name of.
 

 

REMARKS

 
 
  • ??

     

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

    Public Function SHEETNAME(Optional ByVal iSheetNo As Integer = -1) As String

       Call Application.Volatile(True)

       If iSheetNo = -1 Then
          SHEETNAME = Application.ActiveSheet.Name
       Else
          SHEETNAME = Application.Sheets(iSheetNo).Name
       End If

    End Function
       

     

    Example

     


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