Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following procedures will loop through a specified directory and
pull all the file names. Is there a way to adjust this code to loop through a directory and all of it's subdirectories and pull the file names and paths. TIA David Sub Get_File_Names(SearchDir As String) Dim FoundFiles Dim FileName As String Index = 1 FoundFiles = DirList(SearchDir) End Sub Function DirList(Indir As String) Dim FileMatrix(1 To 500) On Error Resume Next ListFile = Dir(Indir) ' Index = 1 Do While Not ListFile = "" FileMatrix(Index) = ListFile Range("SourceFiles1").Rows(Index).Value = Indir & ListFile Index = Index + 1 ListFile = Dir() Loop End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
All Subdirectories | Excel Programming | |||
import few text files from subdirectories | Excel Programming | |||
list of all subdirectories in a given directory in excel | Excel Worksheet Functions | |||
Subdirectories | Excel Programming | |||
Change names of files in a folder to match names in Excel Column | Excel Programming |