Private Sub Worksheet_Calculate()
Dim flag As Boolean
Dim z As Integer
Application.EnableEvents = False
With Sheets("portefeuille- compte")
For z = 55 To 10 Step -1
If .Cells(z, 15).Value = "VENTE" Then
.Range(.Cells(z, 1), .Cells(z, 15)).Copy
With Sheets("histo")
.Range("A9").PasteSpecial Paste:=xlValues
.Rows("9:9").Insert Shift:=xlDown
End With
Application.CutCopyMode = False
.Rows(z).Delete
End If
Next z
End With
Application.EnableEvents = True
End Sub