Sub tt()
commit_path = Range("F18")
Filename = Right(commit_path, Len(commit_path) - InStrRev(commit_path, "\"))
MsgBox "222" & Filename
End Sub
Dim strPath As String
strPath = "C:\folder\folder\folder\file.txt"
Dim strFile As String
strFile = Right(strPath, Len(strPath) - InStrRev(strPath, "\"))
参考
https://stackoverflow.com/questions/5932909/extract-filename-from-path