-
Mid Function in VBA
I have directory listing in excel like:
C:\temp\abc.doc
C:\temp\bvs.doc
C:\temp\temp1\abc.doc
C:\temp\tempkasfcdsafdf\jdkg.xls
how can i use the mid function to get only
C:\temp\
C:\temp\
C:\temp\temp1\
C:\temp\tempkasfcdsafdf\
basically the path minus the actual filename? Thanks
-
Re: Mid Function in VBA
u can use instrrev() & mid() for this
temp = instrrev(strfilePath,"\")
FileName = trim(mid(strfilePath,temp))
hope this will work
-
Re: Mid Function in VBA
Not a VB person but how would I use this in the excel cell itself.
Say in F2 I have text c:\temp\temp.txt in cell G2 how would I derieve c:\temp?