Free Excel UDF that displays the name of the Excel workbook without its extension. This is a great UDF (user defined function) to use when you want to display the name of your workbook but don't want to have to also display the workbook file extension .xls .xlsm etc.
This UDF is simple to use as it requires no arguments or user-supplied data; just enter it into your spreadsheet and you're done.
Function NAMEWORKBOOK() As String
NAMEWORKBOOK = Left(ThisWorkbook.Name, InStr(1, ThisWorkbook.Name, ".", vbTextCompare) - 1)
End Function