Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking Files in a folder

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
Dear All,

Is there a way to count how many files are in a specific folder using VBA, I need at the end of the month to know how many .xls files are stored in a folder, and if the number is less than the number of days in the month, I need to know what days are missing from the folder, the missing file names need to be added to a worksheet,with the folder name on it, so I know how many files for that folder a re missing. I have to run the routine for 11 different folders, the file names for each file in each folder is dd.mm.yy.xls

Is this possible?

Thanks for any help on this.

 
Rob - check this thread.
To make it work for multiple folders, just add an exterior loop - assuming you have a list of folder paths in A1:a11 in sheet1
For i = 1 to 11
myPath = sheets("Sheet1").range("A" & i).text
'do interior loop to count files
Next i

HTH Rgds
~Geoff~
 
D'oh - forgot the thread [blush]
thread705-256951 Rgds
~Geoff~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top