Sub Inversion(s As Byte)
Dim L As Range, lig&, P As Range, tablo, t$, mem(), i&, n&, temp
Set L = ActiveSheet.Shapes(Application.Caller).TopLeftCell.Offset(, -3)
lig = L.Row - 10 '10 à adapter éventuellement
If L <> "" And L(s) <> "" Then
With Sheets("BD")
Set P = .Range("A2", .Range("A" & .Rows.Count).End(xlUp)(2))
End With
tablo = P 'matrice, plus rapide
t = [C3]
ReDim mem(1 To Application.CountIf(P, t))
For i = 1 To UBound(tablo)
If tablo(i, 1) = t Then
n = n + 1
mem(n) = i 'mémorise le n° de ligne
If n = lig + 1 Then Exit For
End If
Next
temp = P(mem(lig)).Resize(, 4)
P(mem(lig)).Resize(, 4) = P(mem(lig + s - 1)).Resize(, 4).Value
P(mem(lig + s - 1)).Resize(, 4) = temp
Else
MsgBox "Pas question !"
End If
End Sub