ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find all the excel files in a folder. (https://www.excelbanter.com/excel-programming/335059-find-all-excel-files-folder.html)

jackm1

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


FastOneBaz[_11_]

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


jackm1[_2_]

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


STEVE BELL

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




jackm1[_4_]

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


jackm1[_3_]

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


STEVE BELL

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





All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com