1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| sub ouvrir()
Dim route, chemin, chemin2, chemin3, nom, nom2, nom3, nom4, sentier, sentier2 As String
Dim wb as workbook
Route = ""C:\Compta\SCORING\Weekly Report\" & format (date, "yyyy") & "\" & format (date,"mmmm") & "\" & format (date, ""ddmmyy")
chemin = "C:\Compta\SCORING\Weekly Report\" & format (date-7, "yyyy") & "\" & format (date-7,"mmmm") & "\" & format (date-7, ""ddmmyy")
chemin2 = "C:\Compta\SCORING\Weekly Report\" & format (date-6, "yyyy") & "\" & format (date-6,"mmmm") & "\" & format (date-6, ""ddmmyy")
chemin3= "C:\Compta\SCORING\Weekly Report\" & format (date-8, "yyyy") & "\" & format (date-8,"mmmm") & "\" & format (date-8, ""ddmmyy")
Sentier = "Q:\Compta\SCORING\Weekly Report Rating\" & Format(Date, "yyyy")
Sentier2 = "Q:\Compta\SCORING\Weekly Report Rating\" & Format(Date, "yyyy") & "\" & Format(Date, "mmmm")
nom = "Rapport Buyer " & Format(Date, "ddmmyy") & ."xls"
nom2 = "Rapport Buyer " & Format(Date - 7, "ddmmyy") & ."xls"
nom3 = "Rapport Buyer " & Format(Date - 6, "ddmmyy") & ."xls"
nom4= "Rapport Buyer " & Format(Date - 8, "ddmmyy") & ."xls"
If Dir(chemin & nom2) = "" Then Set wb = Workbooks.Open(chemin2 & nom3) else Set wb = Workbooks.Open(chemin3 & nom4)
Workbooks.Add
If Dir(Sentier, 16) = "" Then MkDir Sentier
If Dir(Sentier2, 16) = "" Then MkDir Sentier2
ActiveWorkbook.SaveAs route & nom
end sub |
Partager