From: LondonLad on
Thanks for theses posts no it was the findfirst findnext that i was looking
for I am quite ok with splitting strings both with split and instrrev.


"Dave O." wrote:

>
> "Nobody" <nobody(a)nobody.com> wrote in message
> news:i1f55t$u0h$1(a)speranza.aioe.org...
> > "LondonLad" <LondonLad(a)discussions.microsoft.com> wrote in message
> > news:BB07E72D-2F66-4A7B-AD5A-3781E5953CFD(a)microsoft.com...
> >> Hi
> >> Finding folder extn's is fine but to just find a folder name within a
> >> folder
> >> has me beat.
> >> I have a folder named Music this has 900 sub folders by each artists name
> >> I
> >> want to check the date modified for each sub folder.
> >> I have looked at findfirst findnext API but not sure how to adapt it to
> >> find
> >> sub folder names.
> >
> > Use InStrRev() to find the last two "\", and extract the subfolder name
> > using Mid function. Example:
> >
> > Option Explicit
> >
> > Private Sub Form_Load()
> > Dim pos1 As Long
> > Dim pos2 As Long
> >
> > pos1 = InStrRev("C:\abc\def\ghi.txt", "\")
> > Debug.Print pos1
> > pos2 = InStrRev("C:\abc\def\ghi.txt", "\", pos1 - 1)
> > Debug.Print pos2
> > End Sub
> >
> > Output:
> >
> > 11
> > 7
>
> Oh, do you think that's what he meant, it is rather hard to tell.
> Another way to break the path down is to use Split with the Backslash as the
> delimiter - possibly an easier way to manipulate the path although unless
> you allow for them, UNC paths can be entertaining when split.
>
> Regards
> Dave O.
>
>
> .
>