je demande si c est possible de le faire oui ou non pas de me l écrire
Mon but était de savoir si une personne avais déjà été confronté à ce problème
Et l'"algo" en cause ici est vraiment simple !
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub CommandButton1_Click() voyons Range("A1").Value, Range("B1").Value End Sub Function voyons(depart As Date, arrivee As Date) As Variant Dim toto(), comb As Integer, i As Integer, deb As Date, fin As Date comb = Year(arrivee) - Year(depart) ReDim toto(comb, 1) For i = 0 To comb Select Case i Case Year(arrivee) - Year(depart) deb = DateSerial(Year(arrivee), 1, 1) fin = arrivee Case 0 deb = depart fin = DateSerial(Year(depart), 12, 31) Case Else deb = DateSerial(Year(depart) + i, 1, 1) fin = DateSerial(Year(depart) + i, 12, 31) End Select toto(i, 0) = Year(depart) + i toto(i, 1) = fin + 1 - deb Next Range("C1:F2") = Application.Transpose(toto) End Function