Here's a couple of codes for you.
The first will work OK on a Mac but does require the data to be presorted as you posted. That's easily done if needed.
The second in really only for your interest since it uses the scripting dictionary which in general doesn't work on a Mac. But this code doesn't need pre-sorted data.
Both were tested on the data you posted in Sheets"Raw Data"), with consolidation on the (initially assumed empty) Sheets("sheet3") and Sheets("sheet4") respectively.
Note also that the results may look different because the original formats haven't been transferred, and neither have the column headers. Both easily done if needed.
Sub for_mac() 'works on mac with sorted data as posted. can include a pre-sort if needed
Const c& = 25
Dim r, a, x(), u(), i, j, s, k
Sheets("Raw Data").Activate
r = Cells.Find("*", , , , xlByRows, xlPrevious).Row + 1
a = Cells(1).Resize(r, c)
ReDim x(1 To r, 1 To c), u(r)
For i = 2 To r
u(i) = Join(Array(a(i, 2), a(i, 3), a(i, 4), a(i, 5), _
a(i, 6), a(i, 7), a(i, 8), a(i, 9), a(i, 10), a(i, 11)), Chr(30))
Next i
k = 1: s = 2
For j = 2 To 25: x(k, j) = a(s, j): Next j
For i = 3 To r
If u(i) <> u(s) Then
s = i: k = k + 1
For j = 2 To 25: x(k, j) = a(s, j): Next j
Else
For j = 12 To 25: x(k, j) = x(k, j) & a(i, j): Next j
End If
Next i
Sheets("Sheet3").Range("A2").Resize(k, c) = x
End Sub
and
Sub Uses_Scripdict() 'won't usually work on Mac
Const c& = 25
Dim d As Object, r, a, x(), u, i, j
Sheets("Raw Data").Activate
Set d = CreateObject("scripting.dictionary")
r = Cells.Find("*", , , , xlByRows, xlPrevious).Row
a = Cells(1).Resize(r, c)
ReDim x(1 To r, 1 To c)
For i = 2 To r
u = Join(Array(a(i, 2), a(i, 3), a(i, 4), a(i, 5), _
a(i, 6), a(i, 7), a(i, 8), a(i, 9), a(i, 10), a(i, 11)), Chr(30))
If Not d.exists(u) Then
d(u) = d.Count + 1
For j = 2 To 11: x(d(u), j) = a(i, j): Next j
End If
For j = 12 To c: x(d(u), j) = x(d(u), j) & a(i, j): Next j
Next i
Sheets("Sheet4").Range("A2").Resize(d.Count, c) = x
End Sub
Bookmarks