Bonjour,
Désolé, c'est un oubli de ma part. Voici le code avec les variables déclarées :
sub test()
dim t(), i&, n&, nvl&, racine$
with activesheet
for i = 1 to .usedrange.columns(1).count
if racine = "" then racine = left(.cells(i,1).value, 6)
if .cells(i, 1).value like racine & "*" then
n = n + 1: redim preserve t(1 to n)
t(n) = .cells(i, 1).value
end if
if not .Cells(i + 1).value like racine & "*" then
nvl = nvl + 1
.cells(nvl, 3).resize(1, n) = t
racine = "": n = 0
end if
next i
end with
end sub
Cdlt,