Private Sub CommandButton1_Click()
Dim F1 As Worksheet, F3 As Worksheet, col, n&, cel As Range, lig As Byte, cel1 As Range
Set F1 = Sheets("Feuil1") 'feuille de données
Set F3 = Sheets("Feuil3") 'feuille de restitution
F1.Cells.Copy F3.Cells 'pour copier les formats des colonnes, on peut supprimer ensuite
F3.Rows("2:65536").Clear
col = Application.Match([E14], F1.Rows(1), 0)
If IsError(col) Then Exit Sub
n = 2
For Each cel In F1.Range(F1.Cells(2, col), F1.Cells(65536, col).End(xlUp))
[COLOR="Red"]If LCase(cel) Like "*" & LCase([I14]) & "*" Then[/COLOR]
F1.Cells(cel.Row, 1).MergeArea.EntireRow.Copy F3.Rows(n)
If Not cel.MergeCells Then
lig = Application.Match(cel, Intersect(F3.Cells(n, 1).MergeArea.EntireRow, F3.Columns(col)), 0)
F3.Cells(n, 1).MergeArea.EntireRow.ClearContents
cel.EntireRow.Copy F3.Rows(n + lig - 1)
For Each cel1 In Intersect(F3.Rows(n + lig - 1), F3.UsedRange)
If cel1.MergeCells Then cel1.MergeArea(1) = F1.Cells(cel.Row, cel1.Column).MergeArea(1)
Next
End If
n = n + F3.Cells(n, 1).MergeArea.Count
End If
Next
F3.Activate 'facultatif
End Sub