Hi Tim,
Give the following a try, should do exactly as you need!
Sub timculberson()
Dim HeadingCol As Range, ValueCol As Range, HeadingArr, ValueArr
Dim Heads() As String, HeadCt As Long, AllData() As String, DataCt As Long
Dim i As Long, j As Long, iUB As Long, dPos As Long
Set HeadingCol = Columns("A") 'Set entire column for HeadingCol
Set ValueCol = Columns("B") 'Set entire column for HeadingCol
'Re-set HeadingCol and ValueCol variables to be only in used range
Set HeadingCol = Intersect(HeadingCol, HeadingCol.Parent.UsedRange)
Set ValueCol = Intersect(ValueCol, HeadingCol.EntireRow)
If HeadingCol Is Nothing Or ValueCol Is Nothing Then Exit Sub
HeadingArr = HeadingCol.Value
ValueArr = ValueCol.Value
'Initialize heading array, and populate with unique heading ValueCol
HeadCt = 0
ReDim Heads(0)
iUB = UBound(HeadingArr, 1)
For i = 1 To iUB
If HeadingArr(i, 1) <> "" Then
If InSArr(Heads, HeadingArr(i, 1)) = -1 Then
ReDim Preserve Heads(HeadCt)
Heads(HeadCt) = HeadingArr(i, 1)
HeadCt = HeadCt + 1
End If
End If
Next 'CLL
HeadCt = HeadCt - 1
'Enter headings into AllData array
DataCt = 0
ReDim AllData(HeadCt, DataCt)
For i = 0 To HeadCt
AllData(i, 0) = Heads(i)
Next i
'populate alldata array
For i = 1 To iUB
dPos = InSArr(Heads, HeadingArr(i, 1))
If dPos = 0 Then
DataCt = DataCt + 1
ReDim Preserve AllData(HeadCt, DataCt)
End If
If dPos <> -1 Then AllData(dPos, DataCt) = ValueArr(i, 1)
Next 'i
'transfer alldata array contents back to excel
Application.ScreenUpdating = False
Sheets.Add
For i = 0 To HeadCt
For j = 0 To DataCt
Range("A1").Offset(j, i) = AllData(i, j)
Next 'j
Next 'i
Application.ScreenUpdating = True
End Sub
Function InSArr(ByRef vArray() As String, ByVal vItem As String) As Long
Dim i As Long, iUB As Long
iUB = UBound(vArray)
For i = 0 To iUB
If vArray(i) = vItem Then
InSArr = i
Exit Function
End If
Next 'i
InSArr = -1
End Function
Currently I have it putting the data into a new sheet, if you dont want this, change the "Sheets.Add" in the last block to "cells.clear" or whatever you want to do to clear the output area, and then change the Range("A1") to wherever your initial starting cell is.
If you have any questions, don't hesitate to ask!
Matt