Greasle
New Member
- Joined
- Jul 24, 2017
- Messages
- 21
Function FilePath()
Application.Volatile
FilePath = Evaluate("=SUBSTITUTE(LEFT(CELL(""filename""), FIND(""]"", CELL(""filename"")) - 1), ""["", """")")
End Function
Hi
Code:Sub TestThis() ActiveSheet.Range("A1").Formula = "=SUBSTITUTE(LEFT(CELL(""filename""), FIND(""]"", CELL(""filename"")) - 1), ""["", """")" End Sub
or as a UDF
place this formula in any cell
=FilePath()
place in Standard module
Code:Function FilePath() Application.Volatile FilePath = Evaluate("=SUBSTITUTE(LEFT(CELL(""filename""), FIND(""]"", CELL(""filename"")) - 1), ""["", """")") End Function