Filename in a cell

P

phica dk

How do I get only the filename of the active workbook into a cell.
The "CELL" function returns the name including the whole path.
 
A

anilsolipuram

Public Function getfilepath()
getfilepath = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
End Function

create the the above function and call from your cell by using

formulae =getfilepath()
 
Top