- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 81
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2025-4-5
               
|
¦^´_ 1# john2006168 - Sub Ex()
- Dim Ar(), Ay()
- Set d = CreateObject("Scripting.Dictionary")
- Set d1 = CreateObject("Scripting.Dictionary")
- Set d2 = CreateObject("Scripting.Dictionary")
- With Sheet1
- For Each a In .Range(.[A2], .[A65536].End(xlUp))
- d(a.Value) = a.Value
- d2(a.Value) = a.Value
- Next
- End With
- With Sheet2
- For Each a In .Range(.[A2], .[A65536].End(xlUp))
- d1(a.Value) = a.Value
- d2(a.Value) = a.Value
- Next
- End With
- ReDim Preserve Ar(s): Ar(s) = "¬Û¦PName": s = s + 1
- ReDim Preserve Ay(k): Ay(k) = "¤£¦PName": k = k + 1
- For Each ky In d2.keys
- If d.exists(ky) = True And d1.exists(ky) = True Then
- ReDim Preserve Ar(s) '¬Û¦P
- Ar(s) = ky
- s = s + 1
- Else
- ReDim Preserve Ay(k) '¤£¦P
- Ay(k) = ky
- k = k + 1
- End If
- Next
- With Sheet3
- .Cells = ""
- .[A1].Resize(s, 1) = Application.Transpose(Ar)
- .[B1].Resize(k, 1) = Application.Transpose(Ay)
- End With
- End Sub
½Æ»s¥N½X |
|