Option Explicit
Option Compare Text
Sub test()
On Error Resume Next
Dim x As Long, i As Integer, j As Integer, k As Integer, T As Variant, T1() As String, n As String
n = ActiveSheet.Name
Application.ScreenUpdating = False
Columns("e:G").ClearContents
With Worksheets("Feuil1")
.Activate
.Range("F5:H" & .Range("F65536").End(xlUp).Row + 1).ClearContents 'on efface la plage
T = .Range("A2:D" & .Range("A65536").End(xlUp).Row) 'on récupére le tableau
x = -1
For i = 1 To UBound(T) 'pour chaque ligne du tableau
If T(i, 3) = "oui" Then 'si "oui" en colonne 3
x = x + 1 'on ajoute 1 pour obtenir 0,1,2 etc
ReDim Preserve T1(3, x) 'on redimmensionne le tableau 3 lignes , x colonnes
T1(0, x) = T(i, 1) 'ici on recupere le MODULE
T1(1, x) = T(i, 2) 'ici la TABLE
T1(2, x) = T(i, 4) 'ici le NOM
End If
Next i
'ici on va coller le tableau en l'inversant
.Range("F65536").End(xlUp).Offset(1, 0).Resize(UBound(T1, 2), UBound(T1, 1)) = Application.Transpose(T1)
End With
Erase T, T1
End Sub