- ©«¤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
|
¦^´_ 3# day741025
±q²Ä3Ó¶}©l¤u§@ªí¨Ì§Ç¨ì³Ì«áªº¤u§@ªí- Sub Ex()
- Dim D As Object, Wb(1 To 2) As Workbook, Sh As Worksheet, Rng As Range
- Dim i As Integer
- Set Wb(1) = Workbooks("ÂÂ.xlsx")
- Set Wb(2) = Workbooks("·s.xlsx")
- For i = 3 To Wb(1).Sheets.Count 'ÂÂ.xlsx±q²Ä3Ó¶}©l¤u§@ªí¨Ì§Ç¨ì³Ì«áªº¤u§@ªí
- Set D = CreateObject("SCRIPTING.DICTIONARY") '³]¥ßÅܼƬ°¦r¨åª«¥ó
- Set Rng = Wb(1).Sheets(i).[B2] 'ÂÂ.xlsx¨C¤@¤u§@ªíªºB2¶}©l
- Do
- Set D(Rng.Value) = Rng.Offset(, 1) '¬ö¿ýCÄæ (Rangª«¥ó)
- Set Rng = Rng.Offset(1) 'BÄ橹¤U²¾¤@¦C
- Loop Until Rng = "" 'Rng = ""-> Â÷¶}°j°é
- Set Rng = Wb(2).Sheets(i).[B2] '·s.xlsx±q²Ä3Ó¶}©l¤u§@ªí¨Ì§Ç¨ì³Ì«áªº¤u§@ªí
- Do
- If D.EXISTS(Rng.Value) Then D(Rng.Value).Copy Rng.Offset(, 1)
- 'EXISTS ->¦bDictionaryª«¥ó¤¤«ü©wªº ÃöÁä¦r( Rng.Value ) ¦s¦b¡A¶Ç¦^ True¡AY¤£¦s¦b¡A¶Ç¦^ False¡C
- 'D(Rng.Value).Copy Rng.Offset(, 1) '½Æ»sÀx¦s®æ
- Set Rng = Rng.Offset(1) 'BÄ橹¤U²¾¤@¦C
- Loop Until Rng = ""
- Next
- End Sub
½Æ»s¥N½X |
|