• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Show full path and file name

Hello Experts.

This is regarding creating a user defined function which will show full path and file name in any workbook.

Thanks.
 
Hello Arpana.

Try this!

Showing full path and file name in a worksheet.

Code:
Function FileName()
    FileName = Application.Caller.Parent.Parent.FullName
End Function

In a worksheet, enter the formula: =FileName()

To make it available in any workbook you need to save this function in personal workbook..Hope you got this if not..Shoot the question!
 
You don't need to use VBA if you want the value on a worksheet
=SUBSTITUTE(LEFT(CELL("filename"),FIND("]",CELL("filename"))-1),"[","")
works a treat

=CELL("filename")
Shows the Path, File name and Worksheet
 
Back
Top