- Sub test()
- Dim dic As Object, data, i%
- Set dic = CreateObject("scripting.dictionary")
- data = Range(Cells(1, 1), Cells(1, 2).End(4))
- For i = 1 To UBound(data)
- If Not dic.exists(data(i, 1)) Then
- dic.Add data(i, 1), data(i, 2)
- Else
- If InStr(dic(data(i, 1)), data(i, 2)) = 0 Then
- dic(data(i, 1)) = dic(data(i, 1)) & " , " & data(i, 2)
- End If
- End If
- Next
- Cells(1, 3).Resize(dic.Count, 1) = Application.Transpose(dic.keys)
- Cells(1, 4).Resize(dic.Count, 1) = Application.Transpose(dic.items)
- Columns(4).TextToColumns Destination:=Cells(1, 4), OtherChar:=" , "
- Cells.Columns.AutoFit
- Set dic = Nothing
- End Sub
½Æ»s¥N½X ¥H¤W¦¹¥N½X,¦p¦ó§âµ²ªG±o¨Ó¬O¥H¨CÓÄæ¥N´À" , "
¥H²{®É±o¥Xµ²ªG,¤Q¤À²V¶Ã
ÁÂÁÂÀ°¦£ |