I look at creating a VBA macro that will โsearchโ the folder for the keyword โfuelโ and discard all information from all returned files and put them in the data sheet.
For example, I have the week numbers in the folder (1 - 52 cross the year, so in the new year it will contain only one folder, but it will build and build as the year continues), so I look for this folder for all .doc files contain the word "fuel". You can do this through a search in the windows, simply by typing โfuelโ in the search function in the upper corner, and it will display all the file names, and all files contain the words โfuelโ inside them.
I currently have it, but it is only looking for a file with "fuel" in its name, and not with its insisde.
Sub LoopThroughFiles() Dim MyObj As Object, MySource As Object, file As Variant file = Dir("c:\testfolder\") While (file <> "") If InStr(file, "fuel") > 0 Then MsgBox "found " & file Exit Sub End If file = Dir Wend End Sub
I did a few searches for this, but I just can't get anything to work :( My VB skills need to be updated, I think.
Thank you for the advanced.
Jb
source share