Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Folder search

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
search a folder? JCW New Users to Excel 2 July 8th 09 07:26 PM
Microsoft Search opens when I click on a file folder tedster Setting up and Configuration of Excel 1 December 10th 08 06:20 PM
search folder/directory for a phrase inside excel files pwrichcreek Excel Discussion (Misc queries) 5 August 11th 08 09:39 PM
Can Excel search for workbook data in a Windows folder? B Diggity Excel Discussion (Misc queries) 1 October 25th 07 10:24 PM
Import Folder Search Results in a spreadsheet? Mark B Excel Discussion (Misc queries) 1 April 9th 05 05:17 PM


All times are GMT +1. The time now is 09:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"