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 27 28 29 30 31
| option explicit
Sub essai()
Dim fichier As String
Dim extension As String
Dim chemin As String
Dim date1 As Date
Dim date2 As Date
Dim tardif As String
Application.ScreenUpdating = False
Range("H1").Value = Date
Range("G31").Value = "Mon nom et prénom"
extension = ".xls"
chemin = "C:\excel\"
ActiveSheet.Copy
fichier = Range("G31") & "-" & Range("E3") & extension
probleme = Range("I" & Rows.Count).End(xlUp).Row + 1
date1 = Range("J" & Rows.Count).End(xlUp).Row + 1
date2 = Range("K" & Rows.Count).End(xlUp).Row + 1
Application.ScreenUpdating = True
If date1 ' je bloque sur cette partie du code, après avoir testé plein de possibilités ..
With ActiveWorkbook
.SaveAs Filename:=chemin & Day(Date) & "-" & Month(Date) & "-" & Year(Date) & "-" & fichier
.Close
End With
ThisWorkbook.Save
Application.Quit |
Partager