Option Explicit
Sub Delete_Old()
Dim A
Dim Dir_Path As String
Dir_Path = "ICINOMDUDOSSIERATRAITER"
Dim Masq_File, DIR_Result
Dim MyMONTH As String
'------------ LOOK IF ROOT DIRECTORY EXISTS
Masq_File = Dir_Path & "\" & "*.*"
DIR_Result = Dir(Masq_File, vbNormal) ' Init Dir_Result, We start with only files
While (DIR_Result <> "")
'------------ FILES EXIST -----------------
MyMONTH = Mid(DIR_Result, 15, 2) * 1
A = Month(Date) - 1
If (MyMONTH = Month(Date) - 1) Then
Kill Dir_Path & "\" & DIR_Result ' TO REMOVE the FILE
End If
DIR_Result = Dir
Wend
End Sub