Seperate Filename from Location

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
LocAndFile = C:\Folder1\Folder2\Folder3\Excel.xls
FName = mid(locandfile,instrrev(locandfile,"\")+1)
FLoc=left(locandfile,instrrev(locandfile,"\")-1)
 
Back
Top