|
-
Sep 16th, 2006, 08:52 AM
#1
Thread Starter
New Member
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
-
Sep 21st, 2006, 08:24 AM
#2
Hyperactive Member
Re: Mid Function in VBA
u can use instrrev() & mid() for this
temp = instrrev(strfilePath,"\")
FileName = trim(mid(strfilePath,temp))
hope this will work
-
Sep 22nd, 2006, 10:12 AM
#3
Thread Starter
New Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|