#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
reference row on another sheet skipping zeros but not skipping li. Brennan Downes Excel Discussion (Misc queries) 2 April 2nd 23 01:28 PM
Sum skipping columns Steve Excel Discussion (Misc queries) 6 March 27th 12 03:15 PM
Skipping Cells CellSkipper Excel Worksheet Functions 5 January 25th 08 09:42 PM
Skipping blanks jmkona Excel Discussion (Misc queries) 2 August 27th 05 01:12 AM
Skipping Dates Sharon Charts and Charting in Excel 5 July 25th 05 12:58 PM


All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"