vba this file path code example
Example: vba file from path
Dim path As String
path = "C:\Temp\data\myfile.txt"
Debug.Print Mid$(path, InStrRev(path, "\") + 1) ' -> myfile.txt
Dim path As String
path = "C:\Temp\data\myfile.txt"
Debug.Print Mid$(path, InStrRev(path, "\") + 1) ' -> myfile.txt