LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Is this possible?

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
_ _
^ąŻ^
--




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"