- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 259
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-30
|
¦^´_ 9# milkpillow
¸Õ¸Õ¬Ý¬O¤£¬O³o¼Ëªº·N«ä- Sub matchdata()
- Dim Ay()
- Set d = CreateObject("Scripting.Dictionary")
- With Sheet2
- For Each A In .Range(.[A2], .[A65536].End(xlUp))
- If d.exists(A.Value) = False Then
- d(A.Value) = Join(Array(A, A.Offset(, 1), A.Offset(, 2), A.Offset(, 3)), ",")
- Else
- d(A.Value) = d(A.Value) & ";" & Join(Array(A, A.Offset(, 1), A.Offset(, 2), A.Offset(, 3)), ",")
- End If
- Next
- End With
- With Sheet1
- For Each A In .Range(.[C2], .[C65536].End(xlUp))
- If d.exists(A.Value) = True Then
- Ar = Split(d(A.Value), ";")
- For i = 0 To UBound(Ar)
- ReDim Preserve Ay(s)
- Ay(s) = Split(A.Offset(, -2) & "," & A.Offset(, -1) & "," & Ar(i), ",")
- s = s + 1
- Next
- Else
- If mystr = "" Then mystr = A Else mystr = mystr & "," & A
- End If
- Next
- End With
- With Sheet3
- .[A2:F65536] = ""
- .[A2].Resize(s, 6) = Application.Transpose(Application.Transpose(Ay))
- MsgBox mystr & "¨S§ä¨ì"
- End With
- End Sub
½Æ»s¥N½X |
|