Bonsoir,
Merci pour votre aide
J'ai également testé une solution en utilisant des collections.
Je place le code ci-après, au cas où ça intéresse quelqu'un un jour. C'est avec deux boucles for, donc pas énormément en rapport avec ma requête initiale, mais sait-on jamais
Option Explicit
Dim tf As Worksheet
Dim lctf&, lrtf&, a&
Dim cib%, cib3%, i&
Dim tabl3 As Variant
Dim col2 As New Collection
Sub Concat()
Set tf = Worksheets("Table flore")
lrtf = tf.Cells(Rows.Count, 1).End(xlUp).row
lctf = tf.Cells(1, tf.Columns.Count).End(xlToLeft).Column
Set col2 = New Collection
With tf
tabl3 = .Range("H1", "I" & lrtf)
'création collection
For cib3 = 1 To lctf
If tf.Cells(1, cib3) = "LB_NOM" Then
On Error Resume Next
For i = LBound(tabl3, 1) To UBound(tabl3, 1)
If tabl3(i, 1) <> "" Then
col2.Add tabl3(i, 1) & " " & tabl3(i, 2) ', CStr(tabl3(i, 1))
End If
Next i
Exit For
End If
Next cib3
On Error GoTo 0
'export collection dans resultat
If col2.Count > 0 Then
For i = 2 To col2.Count
.Cells(i, cib3) = col2(i)
Next i
End If
End With
End Sub
On peut également passer par PowerQuery quand les données sont importées depuis un autre document, ce qui est très rapide !
Bonne journée !