If you know that the file names will always look like that, the easiest way I can think of would be:
Code:
Mid(yourString, InStrRev(yourString, "/") + 5, 6)
The InstrRev starts at the end of the string and looks backwards through it for the slash, and returns a number of the first match. We add 5 to that (f i l e number) and then use Mid to take that character and the next 6.
The method I suggested doesn't care about the folder path, btw, because it's looking from the right. The path could be anything. Mine should operate faster than yours, but not enough that it probably matters unless you're doing it repeatedly.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.