Sub Effacer()
Dim DerL&, col&, i&
With Sheets("Facture")
.Range("E5:G5, D12:E27").ClearContents
.Range("C6").Value = .Range("C6").Value + 1
End With
With Sheets("Historique_facture")
DerL = .Range("a" & Rows.Count).End(xlUp).Row
For i = DerL To 2 Step -1
If .Cells(i, 1) = .Cells(i - 1, 1) Then
For col = 1 To 5
.Cells(i, col) = Replace(.Cells(i, col), .Cells(i - 1, col), "-")
.Cells(i, col).NumberFormat = ";;;"
Next col
End If
Next i
End With
End Sub