Dim lastrow As Long
Application.ScreenUpdating = False
Application.DisplayAlerts = False
lastrow = Range("A65536").End(xlUp).Row 'détecte la dernière ligne occupée
i = 1 '1° ligne traitée
Do While i <> lastrow
If Cells(i, 1).Value = "0000REF010EUR" Then 'détection du "0000REF010EUR"
Rows(i).Insert Shift:=xldown ' xlUp remplacé par xldown
lastrow = Range("A65536").End(xlUp).Row 'détecte la dernière ligne occupée suite à insertion
i = i + 1 'on se repositionne sur la ligne avec "0000REF010EUR"
End If
i = i + 1 'passage ligne suivante
Loop
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Sub AVA2()
Dim lastrow As Long
Application.ScreenUpdating = False
Application.DisplayAlerts = False
lastrow = Range("A65536").End(xlUp).Row 'détecte la dernière ligne occupée
i = 1 '1° ligne traitée
Do While i <> lastrow
If Cells(i, 1).Value = "0000REF010EUR" Then 'détection du "0000REF010EUR"
[COLOR="Red"]Rows(i+1).Insert Shift:=xlUp[/COLOR]
lastrow = Range("A65536").End(xlUp).Row 'détecte la dernière ligne occupée suite à insertion
i = i + 1 'on se repositionne sur la ligne avec "0000REF010EUR"
End If
i = i + 1 'passage ligne suivante
Loop
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub