If your data has a header row, you should show it in your example.
This assume an ordered list of differing numbers in Column A.
Using Mana's Join code but the loop seems clumsy here. Surely a better way.
Sub test()
Dim dic, d
Dim r As Range
Dim i As Long
Dim s As String
Rows(1).Insert
Cells(1, 1) = "TempHeader"
Set dic = CreateObject("Scripting.Dictionary")
Set r = Sheet1.Cells(1, 1).CurrentRegion.Columns(1).Cells
On Error Resume Next
For i = 2 To r.Cells.Count - 1
dic.Add CStr(r(i)), CStr(r(i))
Next
On Error GoTo 0
For Each d In dic
Columns(1).AutoFilter 1, d
For Each r In Cells(1).CurrentRegion.Columns("G:I").Rows
If r.Hidden = False Then
s = s & vbLf & Join(WorksheetFunction.Transpose(WorksheetFunction.Transpose(r)))
End If
Next
Columns(1).Find(d).Offset(, 10) = s
s = ""
Next d
Columns(1).AutoFilter
Rows(1).Delete
End Sub