Hi,
I would like to extract the filename from the path using excel vba. As I open my file I store its name on a variable calle FileVar. I did some research and found an example of deleting the filename from the path using:
.
I am not sure how the above code works, but I need the opposite that the above code is giving me. I need the filename and its extension. Sorry for the simple question, but I couldn't find anything else on the web to help me understand.
Thanks in advance for any help.
I would like to extract the filename from the path using excel vba. As I open my file I store its name on a variable calle FileVar. I did some research and found an example of deleting the filename from the path using:
Code:
Directory = Left(VarFile, InStrRev(VarFile, "\"))
I am not sure how the above code works, but I need the opposite that the above code is giving me. I need the filename and its extension. Sorry for the simple question, but I couldn't find anything else on the web to help me understand.
Thanks in advance for any help.