OneMadCoder
IS-IT--Management
- Mar 26, 2008
- 59
I need to search (100 or so) multiple excel files for a specific field, all contained within one directory. Is there a way to easily do so without opening each one then selecting each tab to search.
If I could append them all that would be fine too...
I pulled this from the web, but encountered errors:
I've replaced the variables with my own
Sub find()
Dim myfile
Dim mypath
mypath = "C:\Users\Chris\Desktop\xls\As Run xls files"
Do
myfile = Dir(mypath & "*.xls")
' Search and Find
DoCmd.TransferSpreadsheet acImport, 8, "RSPF", mypath & myfile
myfile = Dir
Loop Until myfile = ""
End Sub
If I could append them all that would be fine too...
I pulled this from the web, but encountered errors:
I've replaced the variables with my own
Sub find()
Dim myfile
Dim mypath
mypath = "C:\Users\Chris\Desktop\xls\As Run xls files"
Do
myfile = Dir(mypath & "*.xls")
' Search and Find
DoCmd.TransferSpreadsheet acImport, 8, "RSPF", mypath & myfile
myfile = Dir
Loop Until myfile = ""
End Sub