- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# day741025
¸Õ¸Õ¬Ý- Sub Ex()
- Dim D As Object, Wb(1 To 2) As Workbook, Sh As Worksheet, Rng As Range
- Set Wb(1) = Workbooks("ÂÂ.xlsx")
- Set Wb(2) = Workbooks("·s.xlsx")
- For Each Sh In Wb(1).Sheets '¦bWb(1)ªº¤u§@ªí¶°¦Xª«¥ó ¨Ì§Ç¸Ì¨C¤@¤u§@ªí
- Set D = CreateObject("SCRIPTING.DICTIONARY") '³]¥ßÅܼƬ°¦r¨åª«¥ó
- Set Rng = Sh.[B2] 'ÂÂ.xlsx¨C¤@¤u§@ªíªºB2¶}©l
- Do
- D(Rng.Value) = Rng.Offset(, 1) '¬ö¿ýCÄæ¸ê®Æ¨ì¦r¨åª«¥ó
- Set Rng = Rng.Offset(1) 'BÄ橹¤U²¾¤@¦C
- Loop Until Rng = "" 'Rng = ""-> Â÷¶}°j°é
- Set Rng = Wb(2).Sheets(Sh.Name).[B2] '·s.xlsx¨C¤@¤u§@ªíªºB2¶}©l
- Do
- If D.EXISTS(Rng.Value) Then Rng.Offset(, 1) = D(Rng.Value)
- 'EXISTS ->¦bDictionaryª«¥ó¤¤«ü©wªº ÃöÁä¦r( Rng.Value ) ¦s¦b¡A¶Ç¦^ True¡AY¤£¦s¦b¡A¶Ç¦^ False¡C
- 'D(Rng.Value) ¨ú¥X¸ê®Æ
- Set Rng = Rng.Offset(1) 'BÄ橹¤U²¾¤@¦C
- Loop Until Rng = ""
- Next
- End Sub
½Æ»s¥N½X |
|