Count files in a folder
Thanks Dave
Do I copy this macro to any document in the folder? Thanks
"Dave Peterson" wrote:
Option Explicit
Sub testme()
Dim myFolderName As String
Dim FSO As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
myFolderName = "C:\My Documents\excel"
If FSO.folderexists(myFolderName) Then
MsgBox FSO.getfolder(myFolderName).Files.Count
Else
MsgBox "no folder!"
End If
End Sub
Wanna Learn wrote:
Hello
Is there a way to count how many files are there in a folder? thanks
--
Dave Peterson
|