Hi Cmaskew,
The following macro assumes:
1. The SSN entries are all grouped together in consecutive rows.
2. You have headers in row 1 of Sheet2 for the new list to be created.
3. There are only three possible relation types (00, 01 and 02).
It even handles instances where there are more than two children (just keeps adding them in columns further to the right (leaving an empty column between entries).
Sub reorg()
Dim i As Long, LR As Long, NR As Long, NC As Long
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = Sheets("Sheet1")
Set ws2 = Sheets("Sheet2")
LR = ws1.Range("A" & Rows.Count).End(xlUp).Row
With ws2
NR = .Range("A" & .Rows.Count).End(xlUp).Row + 1
For i = 3 To LR
Select Case ws1.Cells(i, 2).Value
Case Is = 0
.Cells(NR, 1).Value = ws1.Cells(i, 3).Value
.Cells(NR, 2).Value = ws1.Cells(i, 4).Value
NR = NR + 1
Case Is = 1
.Cells(NR - 1, 4).Value = ws1.Cells(i, 3).Value
.Cells(NR - 1, 5).Value = ws1.Cells(i, 4).Value
Case Is = 2
NC = WorksheetFunction.Max(7, .Cells(NR - 1, 255).End(xlToLeft).Column + 2)
.Cells(NR - 1, NC).Value = ws1.Cells(i, 3).Value
.Cells(NR - 1, NC + 1).Value = ws1.Cells(i, 4).Value
End Select
Next i
End With
End Sub
I've attached the sample spreadsheet I used. You can open it and run the reorg macro. Hope that helps!
Bookmarks