Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default find all the excel files in a folder.


i have a windows xp directory and in which hundereds of excel fil
resides. Some of those files are empty. is there a code any one of yo
all have that can search through the entire directory and find al
those files and highlight them or move them to another folder. I woul
truly appreciate some help here.
Thanks.
Stasi

--
jackm
-----------------------------------------------------------------------
jackm1's Profile: http://www.excelforum.com/member.php...fo&userid=2539
View this thread: http://www.excelforum.com/showthread.php?threadid=38872

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default find all the excel files in a folder.


Sub Locate_XLS_Files()

Dim path1 As String
Dim bStart, bFinish, FS

Set FS = CreateObject("Scripting.FileSystemObject")

Application.ScreenUpdating = False
Application.DisplayAlerts = False

bStart = Timer

path1 = "C:\myfolder\"

With Application.FileSearch
.NewSearch
.LookIn = path1
.SearchSubFolders = False
.FileType = msoFileTypeExcelWorkbooks
.Execute

b = .FoundFiles.Count

For f = 1 To b

Application.StatusBar = "I have found this file - "
.FoundFiles(f)

Next

End With

bFinish = Timer
Application.StatusBar = "Loop completed in - " & Round((bFinish
bStart) / 60, 2) & " minutes"

End Su

--
FastOneBa
-----------------------------------------------------------------------
FastOneBaz's Profile: http://www.excelforum.com/member.php...nfo&userid=973
View this thread: http://www.excelforum.com/showthread.php?threadid=38872

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default find all the excel files in a folder.


Thanks. But where do I cut and paste your code. I am so sorry if I a
being to green but its a task for me. Thanks again

--
jackm
-----------------------------------------------------------------------
jackm1's Profile: http://www.excelforum.com/member.php...fo&userid=2539
View this thread: http://www.excelforum.com/showthread.php?threadid=38872

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default find all the excel files in a folder.

The code supplied by FastOneBaz is a stand alone macro that goes into a
standard module;
or into a button click macro.

You call it with a button or with Run Macro.

Let us know if you need more help with this...

--
steveB

Remove "AYN" from email to respond
"jackm1" wrote in
message ...

Thanks. But where do I cut and paste your code. I am so sorry if I am
being to green but its a task for me. Thanks again.


--
jackm1
------------------------------------------------------------------------
jackm1's Profile:
http://www.excelforum.com/member.php...o&userid=25399
View this thread: http://www.excelforum.com/showthread...hreadid=388721



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default find all the excel files in a folder.


steve, thanks for your reply. I am utterly confused here. The code sen
may work very well but do I need to put this in a folder where all m
1000 excel files resides.

here is a more detailed version of the problem

all files have

first column, row=date
third row and all the columns with data.

emty file defined

first coulmn=date.
all othe columns empty.

Now I need to find all these empty files with dates in the first colum
but nothing else in the enitre spreadsheet.

Can I save this macro and then copy it to the folder where all thes
files are.
and then run the excel from there, would it find it. how does exce
would look outside the spreadsheet into the folder.......

Thanks for your help

--
jackm
-----------------------------------------------------------------------
jackm1's Profile: http://www.excelforum.com/member.php...fo&userid=2539
View this thread: http://www.excelforum.com/showthread.php?threadid=38872



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default find all the excel files in a folder.


the files are all in .csv format

--
jackm
-----------------------------------------------------------------------
jackm1's Profile: http://www.excelforum.com/member.php...fo&userid=2539
View this thread: http://www.excelforum.com/showthread.php?threadid=38872

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default find all the excel files in a folder.

A couple of things -

The file type will need to be changed to CSV.
(I am not sure how to do this)

The code itself can go anywhere you want.

You can either build a special workbook to hold it. In which case
you will need to open that workbook to use it.
Or you could put it in your Personal.xls (this opens automatically
everytime you open Excel.

--
steveB

Remove "AYN" from email to respond
"jackm1" wrote in
message ...

the files are all in .csv format.


--
jackm1
------------------------------------------------------------------------
jackm1's Profile:
http://www.excelforum.com/member.php...o&userid=25399
View this thread: http://www.excelforum.com/showthread...hreadid=388721



Reply
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
How to find all folder and/or files in a specific location Mr. GetRight Excel Discussion (Misc queries) 0 July 2nd 08 06:51 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven Excel Discussion (Misc queries) 1 January 24th 06 03:28 PM
Find and Replace on all worksheets on all files in a folder Rob Slagle[_3_] Excel Programming 3 April 27th 05 03:12 PM
VBA to find Cell Range in Files in Folder, return value Tom Ogilvy Excel Programming 1 August 26th 04 07:00 PM
how to step thru only one subfolder of a folder to find like files foamfollower Excel Programming 1 November 11th 03 08:40 PM


All times are GMT +1. The time now is 10:34 AM.

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

About Us

"It's about Microsoft Excel"