D
Danny
I have the following code developed in Excel 2002. I have noted from
this group that .Filesearch is not longer supported in ms excel 2007.
I would like for this code to search for text "budget" in all
workbooks and return the file and it's path to either a listbox or
compile a list of all of the files names and path into an Excel
Workbook.
I am kind of lost on reworking this code with VBA in MS Excel 2007.
Any suggestions you have would be greatly appreciated
Sub findfiles()
With Application.FileSearch
.NewSearch
.LookIn = "C:\"
.SearchSubFolders = True
.TextOrProperty = "Budget"
.MatchTextExactly = False
.Filename = "*.xls"
.Execute
For i = 1 To .FoundFiles.Count
UserForm1.ListBox1.AddItem.FoundFiles (i)
Next i
End With
UserForm1.Show
End Sub
this group that .Filesearch is not longer supported in ms excel 2007.
I would like for this code to search for text "budget" in all
workbooks and return the file and it's path to either a listbox or
compile a list of all of the files names and path into an Excel
Workbook.
I am kind of lost on reworking this code with VBA in MS Excel 2007.
Any suggestions you have would be greatly appreciated
Sub findfiles()
With Application.FileSearch
.NewSearch
.LookIn = "C:\"
.SearchSubFolders = True
.TextOrProperty = "Budget"
.MatchTextExactly = False
.Filename = "*.xls"
.Execute
For i = 1 To .FoundFiles.Count
UserForm1.ListBox1.AddItem.FoundFiles (i)
Next i
End With
UserForm1.Show
End Sub