Thread
:
Find Correct Subdirectory
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett[_4_]
external usenet poster
Posts: 2,337
Find Correct Subdirectory
Let us know if this helps.
Sub finddir()
Dim mypath, myname
mypath = "c:\yourfolder\"
myname = Dir(mypath, vbDirectory)
Do While myname < ""
If myname = "yourname" Then ChDir "c:\personal\yourname": Exit Sub
myname = Dir
Loop
End Sub
--
Don Guillett
SalesAid Software
"Stratuser" wrote in message
...
I want to change the current subdirectory to the one that is one level
higher
and contains the string "Russell". I know how to change the directory to
one level higher (ChDir ".."). How can I loop through the subdirectories
to
find the one containing the word "Russell"?
Reply With Quote
Don Guillett[_4_]
View Public Profile
Find all posts by Don Guillett[_4_]