Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Skipping Folders
My question I believe is fairly simple. I am pulling filenames from a
directory but the next thing I have to do is pull file names from a specific folder of each supplier. The folders I am trying to pull from have the same name. I was using this code for just one folder. ______________________________________ Sub DIRECTORY() With Application.FileSearch .NewSearch .LookIn = "Q:\Eng\LIBRARY\DRAWINGS" .SearchSubFolders = True .Filename = "*.dwg*" .FileType = msoFileTypeAllFiles If .Execute() 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count ActiveSheet.Cells(i + 1, 1).Value = _ .FoundFiles(i) Next i Else MsgBox "There were no files found." End If End With End Sub __________________________________________________ ______________ Now I wanna make an "in between" variable or function to skip the supplier folder so I dont have to go through each and every one. I need to get into the Inserts folder of each supplier basically. __________________________________________________ _______________ Sub DIRECTORY() With Application.FileSearch .NewSearch .LookIn = "Q:\Eng\LIBRARY\Supplier\ **VARIABLE FOLDER HERE** \INSERTS\" .SearchSubFolders = True .Filename = "*.dwg*" .FileType = msoFileTypeAllFiles If .Execute() 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." For i = 1 To .FoundFiles.Count ActiveSheet.Cells(i + 1, 1).Value = _ .FoundFiles(i) Next i Else MsgBox "There were no files found." End If End With End Sub THANKS IN ADVANCE TOM M |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
reference row on another sheet skipping zeros but not skipping li. | Excel Discussion (Misc queries) | |||
Sum skipping columns | Excel Discussion (Misc queries) | |||
Skipping Cells | Excel Worksheet Functions | |||
Skipping blanks | Excel Discussion (Misc queries) | |||
Skipping Dates | Charts and Charting in Excel |