Going from A to Z

  • Thread starter Thread starter Vayse
  • Start date Start date
V

Vayse

Hi
I have to write a program that will list the contents of sub directories in
a directory.
These directories are for customer info. Layout like this

N:\FrenchCustomers\A\Cust1
N:\FrenchCustomers\A\Cust2
to
N:\FrenchCustomers\Z\Cust1

So FrenchCustomers, GermanCutomers etc will each have an A to Z
subdirectory.

My question is, whats the best way of stepping through these? Lets say I'm
just doing French customers.

FOLDER_NAME = "N:\FrenchCustomers\"
For stLetter = "A" to "Z"
For Each foundDirectory In
My.Computer.FileSystem.GetDirectories(FOLDER_NAME & stLetter)
Debug.Print(foundDirectory)
Next
Next stLetter

Now, For stLetter = "A" to "Z" won't work.
What should I do instead? I know I can it working by putting the letters in
a table, but that seems wasteful.
Whats the more efficient way?

Thanks
Vayse
 
Vayse,

For CharCode As Integer = 65 To 90
FOLDER_NAME = "N:\FrenchCustomers\" & Chr(CharCode) & "\"
etc

Kerry Moorman
 
Back
Top