Option Explicit
Public Sub Macro()
Dim mem1 As Long, mem2 As Long, mem3 As Long
'mémoriser les options d'excel et les désactiver
mem1 = Application.ScreenUpdating: Application.ScreenUpdating = False 'raffraichissement de l'affichage
mem2 = Application.EnableEvents: Application.EnableEvents = False 'gestion des évènements
mem3 = Application.Calculation: Application.Calculation = xlCalculationManual 'mode de calcul
'Exécuter la macro
On Error Resume Next
MacroInt
On Error GoTo 0
'rétablir les options d'excel
Application.ScreenUpdating = mem1
Application.EnableEvents = mem2
Application.Calculation = mem3
End Sub
Private Sub MacroInt()
Dim y As Long, Var As Excel.Range
Var = Sheets("GENERAL").Range("B20")
For y = Sheets("NAVISION").Range("C65536").End(xlUp).Row To 2 Step -1
If (Sheets("NAVISION").Cells(y, 3).Value > Var And Sheets("NAVISION").Cells(y, 21).Value = "Yes") Then Rows(y).Delete
If (Sheets("NAVISION").Cells(y, 3).Value <= Var And Sheets("NAVISION").Cells(y, 21).Value = "No") Then Rows(y).Delete
Next
End Sub