Function to return filepath given full filename
"Tom Ogilvy" wrote...
....
If you have excel 2000 or later, you can use split to get the filename
sStr = "C:\Myfolder1\myfolder2\myfile.xls"
v = (sStr,"\")
sPath = Left(sStr,len(sStr)-v(ubound(v)))
....
If OP has XL2K or later, OP could use InStrRev.
p = InStrRev(sStr, "\")
sPath = IIf(p 0, Mid(sStr, p + 1), "")
|