Is it possible to determine the basename, i.e. the last path component of a file path in Excel without defining a custom VBA function?
For example, if cell A1
has the value
C:\Some\deep\directory\structure\file.txt
the formula in B1
should use A1
to return
file.txt
Any ideas?
To extract filename from the file, we use “GetFileName()” method of “Path” class. This method is used to get the file name and extension of the specified path string. The returned value is null if the file path is null.
Under the "Data" Tab, click "Edit Links" - this should show you the files you have linked to, and you can "Change Source" to update it. Alternatively, you could do a simple Find/Replace (CTRL+F, then click "replace" and type the path you need to replace and then in the replace area, put the new path).
=RIGHT(A1,LEN(A1)-FIND("|",SUBSTITUTE(A1,"\","|",LEN(A1)-LEN(SUBSTITUTE(A1,"\","")))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With