Hi
I want to count all excel, Word, Pdf, Tif, .msg in folder file extension wise i want count please tell me how to do this
I want to count all excel, Word, Pdf, Tif, .msg in folder file extension wise i want count please tell me how to do this
Code:
Sub sample()
Dim FolderPath As String, path As String, count As Integer
FolderPath = "C:\Users\swami\Desktop\Temp"
path = FolderPath & "\*.xls"
Filename = Dir(path)
Do While Filename <> ""
count = count + 1
Filename = Dir()
Loop
Range("A2").Value = count
'MsgBox count & " : files found in folder"
End Sub