Returns the name of the worksheet in a given position.

'iSheetNo - The number of the worksheet you want the name of.

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

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

End Function

You can also get the name of the worksheet by using the CELL function.
You can use the following formula

=MID(CELL("filename",A1)), FIND("]",CELL("filename",A!)) + 1, 1000) 

In Power Utility Pak this function is called SHEETNAME

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