Re : If then else
Désolé le code est (changer la date en jaune 31/12/2014) et ça marche
Sub IfDuration()
Dim RowNum As Integer
RowNum = 2
Do While Not (IsEmpty(Cells(RowNum, 1)))
If Cells(RowNum + 1, 1) <> Cells(RowNum, 1) And Cells(1, 4) >= Cells(RowNum, 2) Then
Cells(RowNum, 3) = Cells(1, 4) - Cells(RowNum, 2)
ElseIf Cells(RowNum + 1, 1) = Cells(RowNum, 1) And Cells(1, 4) >= Cells(RowNum + 1, 2) Then
Cells(RowNum, 3) = Cells(RowNum + 1, 2) - Cells(RowNum, 2)
Else: Cells(RowNum, 3) = """"
End If
RowNum = RowNum + 1
Loop
End Sub