Seperate Filename from Location

G

Guest

I have a filename and a location in a Variable

LocAndFile = C:\Folder1\Folder2\Folder3\Excel.xls

What want to do is seperate the location from the filename. The location
will be different so I would need it to be flexible to seperate them out no
matter how deep in a folder the file is

Result
Loc = C:\Folder1\Folder2\Folder3
File = Excel.xls
 
G

Guest

LocAndFile = C:\Folder1\Folder2\Folder3\Excel.xls
FName = mid(locandfile,instrrev(locandfile,"\")+1)
FLoc=left(locandfile,instrrev(locandfile,"\")-1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top