Bonjour,
Petite erreur de ma part sur l'incrément de la boucle désolé. J'en ai profité pour rajouter une gestion d'erreur dans le cas où aucune commune ne correspond au critère :
Sub ExtraitLignesMot()
With Worksheets("Conforme")
mot = "*" & .[C1] & "*"
bd = .Range("A2:F" & .[B65000].End(xlUp).Row)
For i = 1 To UBound(bd)
If bd(i, 2) Like mot Then
temp_g = temp_g & i & ","
Else
temp_b = temp_b & i & ","
End If
Next i
.Range(.[b2], .[b2].End(xlDown)).ClearContents
If Not IsEmpty(temp_g) Then
g = Application.Index(bd, Application.Transpose(Split(temp_g, ",")), 2)
.Cells(2, 6).Resize(UBound(g) - 1, UBound(g, 2)) = g
End If
If Not IsEmpty(temp_b) Then
b = Application.Index(bd, Application.Transpose(Split(temp_b, ",")), 2)
.Cells(2, 2).Resize(UBound(b) - 1, UBound(b, 2)) = b
End If
End With
End Sub
Cdlt,