P
Paul
I've used the following code to list the files in a specified directory, but
I would like to modify it so it would list the subdirectories in that
location instead of the files.
Sub testDir2(strpath As String)
Dim strFile As String
If Right(strpath, 1) <> "\" Then strpath = strpath & "\"
strFile = Dir(strpath)
Do Until Len(strFile) = 0
' do something with strFile
Debug.Print strFile
' get next file
strFile = Dir
Loop
End Sub
How can I modify that code to list the directories instead of the files?
Thanks in advance,
Paul
I would like to modify it so it would list the subdirectories in that
location instead of the files.
Sub testDir2(strpath As String)
Dim strFile As String
If Right(strpath, 1) <> "\" Then strpath = strpath & "\"
strFile = Dir(strpath)
Do Until Len(strFile) = 0
' do something with strFile
Debug.Print strFile
' get next file
strFile = Dir
Loop
End Sub
How can I modify that code to list the directories instead of the files?
Thanks in advance,
Paul