Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Del,
Try - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Option Explicit Sub TEST() Dim SFS As Object Dim FLD As Object Dim FLE As Object Dim i As Long Dim N_1 As Integer Dim N_2 As Integer Dim N_3 As Integer Dim str_D As String Dim str_M As String str_D = "C:\Temp" Set SFS = CreateObject("Scripting.FileSystemObject") Set FLD = SFS.GetFolder(str_D) For Each FLE In FLD.Files N_1 = N_1 + 1 If FLE.Type = "Microsoft Excel Worksheet" Then N_2 = N_2 + 1 If FLE.DateLastModified < Date - 7 Then FLE.Delete N_3 = N_3 + 1 End If End If Next str_M = "Total Files: " & N_1 - N_3 & vbNewLine str_M = str_M & "Excel Files: " & N_2 - N_3 & vbNewLine MsgBox str_M End Sub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Regards, Soo Cheon Jheong _ _ ^ąŻ^ -- |