作个小循环程序即可。
Sub 汇总数据()
For i = 1 To 6
NowData = Right(Cells(i, 1), Len(Cells(i, 1)) - 6)
k = 0
For j = i + 1 To 6
If NowData = Right(Cells(j, 1), Len(Cells(j, 1)) - 6) Then
k = k + 1
Cells(i, 2 + k) = Cells(j, 2)
End If
Next j
i = i + k
Next i
End Sub
结果如下图