Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Find Correct Subdirectory

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"?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find the correct sum reza Excel Worksheet Functions 8 May 25th 10 12:22 AM
find the correct sum reza Excel Discussion (Misc queries) 1 May 21st 10 11:52 AM
How to find the correct end date dan dungan Excel Worksheet Functions 3 October 17th 08 07:49 PM
Can you please hel me to find the correct formulas george24 Excel Worksheet Functions 1 January 11th 07 11:38 AM
Can't Find Correct Value bw Excel Programming 2 September 19th 04 11:56 PM


All times are GMT +1. The time now is 10:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"