Você pode fazer isso com uma macro
Sub Flatten_em()
Dim inRow, outRow, outCol As Integer
Dim CheckVal As String
inRow = 3
outRow = 2
Sheets(1).Select
Rows("1:1").Select
Selection.Copy
Sheets(2).Select
Rows("1:1").Select
ActiveSheet.Paste
Sheets(1).Select
CheckVal = Cells(2, 2)
Range(Cells(2, 1), Cells(2, 7)).Select
Selection Copy
Sheets(2).Select
Cells(outRow, 1).Select
ActiveSheet.Paste
Do Until Cells(inRow, 2) = ""
outCol = 8
Do While Cells(inRow, 2) = CheckVal
Sheets(1).Select
Range(Cells(inRow, 4), Cells(inRow, 7)).Select
Sheets(2).Select
Cells(outRow, outCol).Select
ActiveSheet.Paste
outCol = outCol + 4
inRow = inRow + 1
Loop
CheckVal = Sheets(1).Cells(inRow, 2)
outRow = outRow + 1
Loop
End Sub