Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Your original requst said :
"What I want to do is to be able to apply this to searching a folder and it's subfolders for a date within the books in the folders." You said within the BOOKS. So my code is searcing all the files in the folder for the year specified by the Input box. The code is leaving open the first file it finds with the date you specified in the 1st worksheets sheet with that date. The code is using DIR() which randomly selects all the files specified which in this case is "*.xls". then it goes through the sheets in the order they are listed in the workbokk from left to right. I'm not sure if the problem is with the date format since I don't know whatt data is actually stopped on and the date you specified in the inputbox. If you want to find the earliest or lastest worksheet with the data you are looking for I need you to specify a different algorithm for which worksheet you want opened. "Sj" wrote: ok, I've done this and when I run it it opens the dialog box to input the date so I tried 01/09/2009 and the excel sheet that opened was the November workbook and not the one titled September would this have anything to with the date is formatted? "Joel" wrote: from Set bk = Workbooks.Open(Filename:=Folder & FName) to Set bk = Workbooks.Open(Filename:=Folder & Year(Sdate) & "\" & FName) Loop "Sj" wrote: When I tried this one I got an error message saying run-time error 1004 and it seems to be at the point where it says Set bk = Workbooks.Open(Filename:=Folder & fname) Any ideas why this would be? SJ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
search a folder? | New Users to Excel | |||
Microsoft Search opens when I click on a file folder | Setting up and Configuration of Excel | |||
search folder/directory for a phrase inside excel files | Excel Discussion (Misc queries) | |||
Can Excel search for workbook data in a Windows folder? | Excel Discussion (Misc queries) | |||
Import Folder Search Results in a spreadsheet? | Excel Discussion (Misc queries) |