Bonjour,
Mettre la première année en cellule R1 qui servira de référence.
Puis cliquez sur le bouton 'Insérer l'année"
le code
Sub Inserer_Annee()
Dim i As Long, AnneeDeb As Long
Dim Jour As String, Mois As String
Application.ScreenUpdating = False
DerLig = Range("B" & Rows.Count).End(xlUp).Row
Range("B5:B" & DerLig).NumberFormat = "@"
AnneeDeb = Range("R1").Value
Jour = Left(Cells(5, "B"), 2)
Mois = Right(Cells(5, "B"), 2)
Cells(5, "B") = CDbl(CDate(Jour & "/" & Mois & "/" & AnneeDeb))
For i = 6 To DerLig
Jour = Left(Cells(i, "B"), 2)
Mois = Right(Cells(i, "B"), 2)
If Mois * 1 < Month(Cells(i - 1, "B")) Then AnneeDeb = AnneeDeb + 1
Cells(i, "B") = CDbl(CDate(Jour & "/" & Mois & "/" & AnneeDeb))
Next i
Range("B5:B" & DerLig).NumberFormat = "m/d/yyyy"
Range("A1").Value = "RESTITUTION DETAILS PAR PERIODE du " & Cells(5, "B") & " au " & Cells(DerLig, "B")
End Sub
Cdlt