- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 247
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-14
|
¦^´_ 1# john2006168 - Sub Ex()
- Dim Ar()
- Set d = CreateObject("Scripting.Dictionary")
- Set dc1 = CreateObject("Scripting.Dictionary")
- With Sheet1
- For Each a In .Range(.[A2], .[A65536].End(xlUp))
- d(a.Value) = a.Offset(, 1)
- Next
- For Each a In .Range(.[D2], .[D65536].End(xlUp))
- dc1(a.Value) = a.Offset(, 1)
- Next
- End With
- Sheet2.Columns("A:E") = ""
- For Each ky In d.keys
- If d(ky) <> dc1(ky) And d(ky) <> "" Then
- ReDim Preserve Ar(s)
- Ar(s) = Array(ky, d(ky))
- s = s + 1
- End If
- Next
- If s > 0 Then Sheet2.[A1].Resize(s, 2) = Application.Transpose(Application.Transpose(Ar))
- s = 0: Erase Ar
- For Each ky In dc1.keys
- If d(ky) <> dc1(ky) And dc1(ky) <> "" Then
- ReDim Preserve Ar(s)
- Ar(s) = Array(ky, dc1(ky))
- s = s + 1
- End If
- Next
- If s > 0 Then Sheet2.[D1].Resize(s, 2) = Application.Transpose(Application.Transpose(Ar))
- End Sub
½Æ»s¥N½X |
|