Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return file from a path string
One way Steph
Dim sFile Dim ary sFile = "C:\folder1\folder2\folder3\folder4\folder5\file.x ls" ary = Split(sFile, "\") MsgBox ary(UBound(ary)) or more directly, but less efficiently Dim sFile sFile = "C:\folder1\folder2\folder3\folder4\folder5\file.x ls" MsgBox Split(sFile, "\")(UBound(Split(sFile, "\"))) -- HTH RP (remove nothere from the email address if mailing direct) "Steph" wrote in message ... I have a string variable that is a path to a file: C:\folder1\folder2\folder3\folder4\folder5\file.xl s How can I create a new variable that is simply the file name.xls? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Concatenate path and file string for external reference | Excel Worksheet Functions | |||
How to extract only file name from folder path string in Excel? | Excel Worksheet Functions | |||
Return file from a path string | Excel Programming | |||
Stripping Path from File String | Excel Programming | |||
Using a variable string in a file save path | Excel Programming |