It is difficult to see the data in text format. If this code does not work, we need to see your sample.
Sub trans()
Dim x, y(), i&, j&, k&
x = Sheets("Sheet1").Range("A2").CurrentRegion.Value
ReDim y(1 To UBound(x, 1) * UBound(x, 2), 1 To UBound(x, 2))
For i = 1 To UBound(x, 1)
For j = 2 To UBound(x, 2)
If Len(x(i, j)) Then
k = k + 1
y(k, 1) = x(i, 1)
y(k, 2) = x(i, j)
End If
Next j
Next i
With Sheets.Add
.UsedRange.ClearContents
.Range("A1").Resize(k, UBound(x, 2)).Value = y()
.Activate
End With
End Sub
Bookmarks