- ©«¤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# GGGYYY
¸Õ¸Õ¬Ý- Option Explicit
- Sub Ex_Match() '¤j¤p¼g¨S¦³¤À§O
- Dim M As Variant, Rng As Range, E As Range
- Set Rng = Sheets("¹ï·Ó").Range("A:A")
- For Each E In Sheets("¼ÆÈ").UsedRange.Columns(1).Offset(1).Cells
- M = Application.Match(E, Rng, 0) '¨S§ä¨ì¶Ç¦^¿ù»~È
- If IsNumeric(M) Then '§ä¨ì¶Ç¦^¼Æ¦r
- Rng.Cells(M, 2).Resize(, 2).Copy E.Offset(, 1)
- Else
- With E.Cells(1, 2).Resize(, 2)
- .Value = ""
- .Interior.ColorIndex = xlNo
- End With
- End If
- Next
- End Sub
- Sub Ex_¦r¨åª«¥ó() '¤j¤p¼g¦³¤À§O
- Dim E As Range, d As Object, i As Integer
- Set d = CreateObject("scripting.dictionary") '¦r¨åª«¥ó
- i = 1
- With Sheets("¹ï·Ó")
- Do While .Cells(i, "a") <> ""
- Set d(.Cells(i, "a").Value) = .Cells(i, "a").Offset(, 1).Resize(, 2)
- i = i + 1
- Loop
- End With
- For Each E In Sheets("¼ÆÈ").UsedRange.Columns(1).Offset(1).Cells
- If d.EXISTS(E.Value) Then 'Dictionary ª«¥ó¤¤«ü©wªºÃöÁä¦r¦s¦b¡A¶Ç¦^ True¡AY¤£¦s¦b¡A¶Ç¦^ False¡C
- d(E.Value).Copy E.Offset(, 1)
- Else
- With E.Cells(1, 2).Resize(, 2)
- .Value = ""
- .Interior.ColorIndex = xlNo
- End With
- End If
- Next
- End Sub
½Æ»s¥N½X |
|