PDA

View Full Version : Solved: How many ".bmp" formatted files in the folder?



Erdin? E. Ka
09-28-2006, 08:35 AM
Hi everyone, :hi:

I need a sample code about "how to counting ".bmp" formatted files in a folder?"

For example;

......
Dim FileFormat as string
Dim FolderName as string
Dim Result as integer
FileFormat = ".bmp"
FolderName: "C:\Pictures\"

Example of result that i want:
MsgBox "Total of the " & FileFormat & formatted files in the " & FolderName & "is " & Result" & "."
......

I tried While ... Wend loop but, i couldn't deal with it.

Can i get the result to a variable? And what should be my code? :dunno

Thans a lot.:help

mdmackillop
09-28-2006, 08:47 AM
Have a look at "FileSearch Object" in the VBA Help files.

Ken Puls
09-28-2006, 08:51 AM
Or here:

Count Files in a directory (All file types or one specific type only, using FileSearch)

HTH,

Erdin? E. Ka
09-28-2006, 11:59 AM
Have a look at "FileSearch Object" in the VBA Help files.

&


Or here:

Count Files in a directory (All file types or one specific type only, using FileSearch)

HTH,


Hi mdmackillop and Ken Puls, it's ok... : pray2:

Thank you very much. :p