Option Explicit
Sub TEST2()
Dim ar, br, i&, j&, r&, n&, iColSize&
Application.ScreenUpdating = False
ar = Sheets(1).[A1].CurrentRegion.Value
ReDim br(1 To UBound(ar), 1 To UBound(ar, 2) * UBound(ar, 2))
For i = 2 To UBound(ar)
r = r + 1
br(r, 1) = ar(i, 3)
n = 1
For j = 4 To UBound(ar, 2)
If Len(ar(i, j)) Then
n = n + 1: br(r, n) = ar(1, j)
n = n + 1: br(r, n) = ar(i, j)
End If
Next j
If n > iColSize Then iColSize = n
Next i
Cells.Clear
[A1].Resize(r, iColSize) = br
Application.ScreenUpdating = True
Beep
End Sub |