½Ð±Ð·j´M¦WºÙ¡@§ä¥X¤é´Á¡@ÁÂÁÂ
- ©«¤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
        
|
¦^´_ 19# mycmyc
¤]¥i¥Î Application.Match¨ç¼Æ- Option Explicit
- Sub Ex()
- Dim Rng(1 To 2) As Range, e As Range, M As Variant, d As Object
- With Sheets("¤u§@ªí2")
- .UsedRange.Clear
- .[a1:b1] = Array("¤é´Á", "¬I¤u¶µ¥Ø")
- End With
- With Sheets("¤u§@ªí1")
- Set Rng(1) = .Range("B6", "B" & .[A6].End(xlDown).Row).Resize(, .[A1].End(xlToRight).Column - 1).SpecialCells(xlCellTypeConstants, 1)
- ' *** .SpecialCells(xlCellTypeConstants, 1) ¬O¼Æ¦rªºÀx¦s®æ ***
- For Each e In Rng(1)
- M = Application.Match(.Cells(e.Row, 1).Text, Sheets("¤u§@ªí2").Columns(1), 0)
- If IsError(M) Then 'Match¤£¨ì '
- Set Rng(2) = Sheets("¤u§@ªí2").Range("A" & Rows.Count).End(xlUp).Offset(1)
- Rng(2) = .Cells(e.Row, 1).Text 'AÄ檺¤é´Á
- Rng(2).Cells(1, 2) = .Cells(1, e.Column) '²Ä¤@¦Cªº¬I¤u¶µ¥Ø
- Else
- Set Rng(2) = Sheets("¤u§@ªí2").Range("A" & M) 'Match¨ì ªº¦C¸¹
- Rng(2).Cells(1, 2) = Rng(2).Cells(1, 2) & "¡B" & .Cells(1, e.Column)
- End If
- Next
- End With
- End Sub
½Æ»s¥N½X |
|
|
|
|
|
|