SheetName

Gets a sheet name by referencing sheet ID or Sheet No
This is more likely to be used as User-Defined-Function (or UDF) inside Excel workbook, but it also can be used as function, especially since we now have Sheet() and Sheets() functions.
http://xlfxs.com/sheet-and-sheets/

Function SheetName(SheetNo)
' Gets sheet name for a given id in thisworkbook
If SheetNo > ThisWorkbook.Worksheets.Count Then
SheetName= "#N/A"
Else
SheetName= ThisWorkbook.Worksheets(SheetNo).Name
End If
End Function

SheetNo

Views 442 Downloads 118

'Sheetname', 'sheet name', 'sheetid', 'sheet id', 'sheetno', 'sheetno', 'sheets', 'worksheets', 'workbook', 'sheets()', 'sheet()'

ANmarAmdeen
323
Attachments
Components VBA-Excel
Revisions

v1.0