vba extract filename from path

The solution for “vba extract filename from path” can be found here. The following code will assist you in solving the problem.

Function GetFilenameFromPath(ByVal strPath As String) As String
If Right$(strPath, 1) <> “\” And Len(strPath) > 0 Then
GetFilenameFromPath = GetFilenameFromPath(Left$(strPath, _
Len(strPath) – 1)) + Right$(strPath, 1)
End If
End Function

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts