Sub Multiplier()
Dim derlig&, t, Tot&, ref, i&, j&, N&
With Sheets("Feuil1")
derlig = .Cells(4, "a").End(xlDown).Row
t = .Range(.Cells(4, "a"), .Cells(derlig, "c"))
ref = ""
For i = 2 To UBound(t)
If t(i, 1) <> ref Then
Tot = Tot + Len(t(i, 2))
ref = t(i, 1)
End If
Next i
ReDim r(1 To Tot + 1, 1 To 3)
For j = 1 To 2: r(1, j) = t(1, j): Next
r(1, 3) = "code produits 2"
N = 1
For i = 2 To UBound(t)
If t(i, 3) = 1 Or t(i, 3) = "" Then
For j = 1 To Len(t(i, 2))
N = N + 1
r(N, 1) = t(i, 1): r(N, 2) = t(i, 2): r(N, 3) = Mid(t(i, 2), j, 1)
Next j
End If
Next i
.Cells(4, "a").Resize(UBound(r), UBound(r, 2)) = r
End With
End Sub