View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Matt Lawson[_3_] Matt Lawson[_3_] is offline
external usenet poster
 
Posts: 2
Default Function to return filepath given full filename

ANy suggestions to improve this function

(I thought about it for a while and came up with a solution

Function ReturnPath(sFname
Dim spath As String, i As Long, leng As Intege
leng = Len(sFname
For i = 1 To leng -
If Mid(sFname, leng - i, 1) = "\" The
spath = Mid(sFname, 1, leng - i - 1
Exit Fo
End I
Nex

ReturnPath = spat

End Function