Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count files in a Folder!
Hi Don.
Thanks a lot. But, if instead of the message Box the value "returns" to a cell, how would the programing Be? Thankīs a lot!! SpeeD -----Original Message----- try this Sub filescount() Set fs = Application.FileSearch With fs .LookIn = "C:\a" .SearchSubFolders = True .Filename = "*.*" If .Execute() 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." ' For i = 1 To .FoundFiles.Count ' MsgBox .FoundFiles(i) ' Next i Else MsgBox "There were no files found." End If End With End Sub "SpeeD72" wrote in message ... Hi guys. How can a make a formula that gives me the "count" of files in a Folder? If it insīt possible in a formula can i make a macro that gives me this "Count" in a cell? how? Thanks a lot SpeeD72 . |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count files in a Folder!
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found." range("a1")=.foundfiles.count "SpeeD72" wrote in message ... Hi Don. Thanks a lot. But, if instead of the message Box the value "returns" to a cell, how would the programing Be? Thankīs a lot!! SpeeD -----Original Message----- try this Sub filescount() Set fs = Application.FileSearch With fs .LookIn = "C:\a" .SearchSubFolders = True .Filename = "*.*" If .Execute() 0 Then MsgBox "There were " & .FoundFiles.Count & _ " file(s) found." ' For i = 1 To .FoundFiles.Count ' MsgBox .FoundFiles(i) ' Next i Else MsgBox "There were no files found." End If End With End Sub "SpeeD72" wrote in message ... Hi guys. How can a make a formula that gives me the "count" of files in a Folder? If it insīt possible in a formula can i make a macro that gives me this "Count" in a cell? how? Thanks a lot SpeeD72 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pulling pdf files from general folder to specific folder | Excel Discussion (Misc queries) | |||
Count files in a folder | Excel Discussion (Misc queries) | |||
Copying all files in a folder to new folder | 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) | |||
Count files in a Folder! | Excel Programming |