パスからファイル名を抽出
ファイルパスからファイル名のみを抽出します。
Option Explicit
MsgBox fnGetFileNameByFilePath("C:\abc\test.txt")
Function fnGetFileNameByFilePath(ByVal strPath)
Dim lIdx
Dim strName
lIdx = InStrRev(Replace(strPath,"/","\"), "\")
If lIdx > 0 Then
strName = Right(strPath, Len(strPath) - lIdx)
Else
strName = strPath
End If
fnGetFileNameByFilePath = strName
End Function