I am not good with excel interfaces at all, but I can write the code. E.G. - if I have a table that is two columns and starts in col A (cells start in A1, duplicate col is col A, related nums are in col B), I write this to transform it:
Code:
Option Explicit
Option Base 1
Sub trans()
Dim i As Long
Dim r As Range
Dim r2 As Range
Dim curVal As String
Dim NewListPos As Long 'record num
Dim NewListCol As Long
Dim usedVals() As String
NewListPos = 0
NewListCol = 0
'loop col1 for distinct values and pull related col2
For Each r In Range("a1", Range("a1").End(xlDown))
i = 1
curVal = r
'if this is first num in list, resize array and move on
If r.Address = "$A$1" Then
ReDim Preserve usedVals(1)
usedVals(1) = r
GoTo Midline
End If
For i = LBound(usedVals) To UBound(usedVals)
'have we used this num as a ref before?
If curVal = usedVals(i) Then
GoTo NextLoop
End If
Next i
'if new num, resize array
ReDim Preserve usedVals(UBound(usedVals) + 1)
usedVals(UBound(usedVals)) = curVal
Midline:
'if new num, start a new transformed row
NewListPos = NewListPos + 1
Range("D" & CStr(NewListPos)) = r
'set up for first piece of data
NewListCol = 1
'if new num, pull all nums in col2
For Each r2 In Range("a1", Range("a1").End(xlDown))
If r2 = curVal Then
Range("D" & CStr(NewListPos)).Offset(0, NewListCol) = r2.Offset(0, 1)
NewListCol = NewListCol + 1
End If
Next r2
NextLoop:
Next r
End Sub