I am trying to filter out excel files from a folder. The excel files in the folders are filtered by looking in a cell and if the value in that cell matches a case in the macro, then the folder is copied and pasted into anther folder. Unfortunetly the values in the cell which determines if the folder is copied are name multiple names. all Values though have the name CleanTech in them. So I am trying to figure out if I could use "*CleanTech*" to help me find all the correct excel files. I though since it works in Access it might work in my excel vba?
heres the peice of code im playing with
For Each sfl In fld.SubFolders
For Each fil In sfl.Files
fCopy = False
If Right(fil.Name, 4) = ".xls" Then
Set wbk = Workbooks.Open(Filename:=strSource & sfl.Name & "" & fil.Name, AddToMRU:=False)
'Search the worksheet and cell for case
Select Case wbk.Worksheets(1).Range("C14")
'Enter the job names suitable for moving. ex. "cleantech","WaterFoam", .....
'Case "CleanTech", "Foamed CleanTech", "Foamed", "Foam", "CleanTech Foam", " Foamed CleanTech"
fCopy = True
If fCopy Then
'below copies and paste to folder
'below cuts and paste the folder to the target folder
'sfl.Move strTarget & sfl.Name