Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to find all folder and/or files in a specific location | Excel Discussion (Misc queries) | |||
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? | Excel Discussion (Misc queries) | |||
Find and Replace on all worksheets on all files in a folder | Excel Programming | |||
VBA to find Cell Range in Files in Folder, return value | Excel Programming | |||
how to step thru only one subfolder of a folder to find like files | Excel Programming |