A
Alex St-Pierre
Hello,
There is a function which allow me to have the list
of files in a directly (see below). What I need is to have
the list of all "sub directories" in a specific folder. I
want the name of all subdirectory in a worksheet. Does
anyone knows what is the modification I should do?
Thank you
Alex
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Windows"
.SearchSubFolders = True
.FileName = "cmd*"
If .Execute() > 0 Then
MsgBox "This folder contains " & .FoundFiles.Count
& _
" file(s)."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "No file as been found."
End If
End With
There is a function which allow me to have the list
of files in a directly (see below). What I need is to have
the list of all "sub directories" in a specific folder. I
want the name of all subdirectory in a worksheet. Does
anyone knows what is the modification I should do?
Thank you
Alex
Set fs = Application.FileSearch
With fs
.LookIn = "C:\Windows"
.SearchSubFolders = True
.FileName = "cmd*"
If .Execute() > 0 Then
MsgBox "This folder contains " & .FoundFiles.Count
& _
" file(s)."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "No file as been found."
End If
End With