Private Sub CommandButton2_Click()
Dim n&, i&, k&
n = Me.TextBox1.Value
With Sheets(1)
For i = 3 To .[a65000].End(xlUp).Row
If .Cells(i, "A").Value = n Then
.Range(.Cells(i, "A"), .Cells(i, "L")).Copy Sheets(2).Cells(Sheets(2).[a65000].End(xlUp).Row + 1, 1)
k = k + 1
End If
Next i
End With
If k = 0 Then MsgBox "Aucun résultat"
End Sub
Dim n&, i&, k&
n = Me.TextBox1.Value
With Sheets(1)
For i = 3 To .[c65000].End(xlUp).Row
If .Cells(i, "C").Value = n Then
.Range(.Cells(i, "C"), .Cells(i, "L")).Copy Sheets(2).Cells(Sheets(2).[c65000].End(xlUp).Row + 1, 1)
k = k + 1
End If
Next i
End With
If k = 0 Then MsgBox "Aucun résultat"
Dim n, i&, k&
.Range(.Cells(i, "A"), .Cells(i, "L")).Copy Sheets(2).Cells(Sheets(2).[a65000].End(xlUp).Row + 1, 1)