Sub Macro2()
Dim ID_Cas As String
ID_Cas = Range("A3").Value
Date1 = Range("C3").Value
For i = 4 To Sheets("Rapport1").Range("A" & Application.Rows.Count).End(xlUp).Row + 1
If Range("A" & i) <> ID_Cas Then
Date2 = Range("C" & i - 1)
' *** à tester sous 2003
'res = Application.WorksheetFunction.networkdays(Date1, Date2) - 1
'Range("D" & i - 1) = Date2 - Date1 - res
' **********************
' *** sous XL 2000
' traitement jours ouvrés
we = 0
j = 0
Do While Int(Date1) + j < Int(Date2)
If Weekday(Date1 + j, 2) >= 6 Then we = we + 1
j = j + 1
Loop
Range("D" & i - 1) = Date2 - Date1 - we
' **********************
Range("D" & i - 1).NumberFormat = "[h]:mm:ss"
ID_Cas = Range("A" & i)
Date1 = Range("C" & i)
End If
Next i
For b = i - 1 To 1 Step -1
'A faire via une macro est le mot que mon extract me donne.
If Cells(b, 4).Value = "A faire via une macro" Then
Rows(b).Delete
End If
Next b
End Sub