Private Sub CommandButton3_Click()
Sheets("Modèle").Select
Cells.Copy
Sheets.Add
Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
, Transpose:=False
ActiveSheet.Name = InputBox("Nommez la feuille")
If ActiveSheet.Name = "Stat 2012" Or ActiveSheet.Name = "Présentation" Then Exit Sub
For c = Cells(2 ^ 16, 4).End(xlUp).Row To Cells(14, 4).Row Step -1
If Cells(c, 4) = "CT" Then
Cells(8, 3) = DateSerial(Year(Cells(c, 1)) + 5, Month(Cells(c, 1)), Day(Cells(c, 1)) - 15) '1ere ligne
GoTo Révision
End If
Next c
Cells(8, 3) = DateSerial(Year(Cells(4, 5)) + 5, Month(Cells(4, 5)), Day(Cells(4, 5)) - 15) '2nde ligne
Révision:
For r = Cells(2 ^ 16, 4).End(xlUp).Row To Cells(14, 4).Row Step -1
If Cells(r, 4) = "Révision" Then
Cells(8, 6) = ((Cells(r, 2) + 30000) \ 30000) * 30000
Exit Sub
End If
Next r
Cells(8, 6) = ((Cells(5, 5) + 30000) \ 30000) * 30000
Range("B3").Select
MsgBox "Vous pouvez compléter les renseignements"
Unload Me
End Sub