'Run with Input sheet active. Set r1 to suit.
Sub Main()
Dim r0 As Range, r1 As Range, r2 As Range, r As Range
Dim c As Range, ws0 As Worksheet, ws As Worksheet, a, b, v
On Error GoTo TheEnd
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.EnableEvents = False
'Set first cell range with uniques, the column heading cell.
'Set to suit.
Set r0 = [C3] '<<<<<<<-------CHANGE THIS?
Set r1 = r0.Offset(1)
'Input sheet must be the activesheet.
Set ws0 = ActiveSheet
'Set range of the 2 input columns
Set r = Range(r1, Cells(Rows.Count, r1.Row).End(xlUp))
'Assign unique names to array.
Set r1 = Intersect(Columns(r1.Column), r)
a = r1
a = UniqueArrayByDict(a)
'Uncomment to sort uniques.
'a = advArrayListSort(a)
'Create an output worksheet
Set ws = Worksheets.Add(after:=Worksheets(Worksheets.Count))
'Rename output sheet
ws.Name = "Output"
'Format output column cells
With ws
r0.Copy .[a1]
r1(1).Copy
.[a2].Resize(UBound(a) + 1).PasteSpecial xlPasteFormats
.[a2].Resize(UBound(a) + 1).Value = WorksheetFunction.Transpose(a)
End With
'Filter Input sheet for each unique column value.
Set r = r.Offset(-1).Resize(r.Rows.Count + 1)
Set c = ws.[b2] 'First cell in column 2 of output
For Each v In a
'Filter Input sheet for each unique column value.
r.AutoFilter 1, v
'Set column 2 visible range, less title cell.
Set r2 = r.Offset(1)
Set r2 = Intersect(r2, r.Columns(2).SpecialCells(xlCellTypeVisible))
b = RangeTo1dArray(r2)
'Uncomment next line if transposed data should be sorted.
'b = advArrayListSort(b)
c.Resize(, UBound(b) + 1).Value = b 'WorksheetFunction.Transpose(b)
Set c = c.Offset(1)
Next v
ws.UsedRange.EntireColumn.AutoFit 'Resize Output columns
r.AutoFilter 'Turn Autofilter off.
TheEnd:
Application.CutCopyMode = True
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub