Private Sub Worksheet_Activate()
Dim tablo, resu(), i&, test1 As Boolean, test2 As Boolean, n&, j%, x$, y$
tablo = [Table1] 'matrice, plus rapide
ReDim resu(1 To UBound(tablo), 1 To 6)
For i = 1 To UBound(tablo)
test1 = tablo(i, 9) = "Guich" And tablo(i, 10) Like "*Applicatifs*"
test2 = tablo(i, 13) = "Guich" And tablo(i, 14) Like "*Applicatifs*"
If test1 Or test2 Then
n = n + 1
For j = 1 To 4: resu(n, j) = tablo(i, j + 4): Next
resu(n, 5) = "Guich"
If test1 Then x = Recup(tablo(i, 10)) Else x = ""
If test2 Then y = Recup(tablo(i, 14)) Else y = ""
resu(n, 6) = x & IIf(test1 And test2, ";", "") & y 'concaténation
End If
Next
'---testitution---
If FilterMode Then ShowAllData 'si la feuille est filtrée
With [A2] '1ère cellule de destination
If n Then .Resize(n, 6) = resu
.Offset(n).Resize(Rows.Count - n - .Row, 6).ClearContents 'RAZ en dessous
End With
Columns("A:F").AutoFit 'ajuste les largeurs
With UsedRange: End With 'actualise la barre de défilement verticale
End Sub
Function Recup$(x)
Dim s, i%
s = Split(x, ";")
For i = 0 To UBound(s)
If s(i) Like "*Applicatifs*" Then Recup = Recup & ";" & s(i) 'concaténation
Next
Recup = Mid(Recup, 2)
End Function