How do I get just filename (without path and extension)
like \"MyFileName\"
from the following full path?
C:\\A_B\\C.D\\E_\\F0123456789\\G\\MyFileName.txt
Sub Test()
Dim fileNameOnly As String
fileNameOnly = Left$(Split("C:\A_B\C.D\E_\F0123456789\G\MyFileName.txt", "\")(UBound(Split("C:\A_B\C.D\E_\F0123456789\G\MyFileName.txt", "\"))), InStrRev(Split("C:\A_B\C.D\E_\F0123456789\G\MyFileName.txt", "\")(UBound(Split("C:\A_B\C.D\E_\F0123456789\G\MyFileName.txt", "\"))), ".") - 1)
Debug.Print Strtf
End Sub