Public Sub KyQua()
Dim Dic As Object, sArr(), dArr(), I As Long, K As Long, Col As Long, Tem As String
Set Dic = CreateObject("Scripting.Dictionary")
sArr = Range([A11], [A65536].End(xlUp)).Resize(, 4).Value
ReDim dArr(1 To UBound(sArr, 1), 1 To UBound(sArr, 1) / 2)
Col = 1
K = 1
For I = 1 To UBound(sArr, 1)
If sArr(I, 2) = Empty Then
Col = Col + 1
dArr(1, Col) = sArr(I, 1)
Else
Tem = sArr(I, 1)
If Not Dic.Exists(Tem) Then
K = K + 1
Dic.Add Tem, K
dArr(K, 1) = Tem
dArr(K, Col) = sArr(I, 4)
Else
dArr(Dic.Item(Tem), Col) = sArr(I, 4)
End If
End If
Next I
[I2].Resize(K, Col) = dArr
Set Dic = Nothing
End Sub