ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

½Ð±Ð·j´M¦WºÙ¡@§ä¥X¤é´Á¡@ÁÂÁÂ

¦^´_ 19# mycmyc
¤]¥i¥Î Application.Match¨ç¼Æ
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Rng(1 To 2) As Range, e As Range, M As Variant, d As Object
  4.      With Sheets("¤u§@ªí2")
  5.         .UsedRange.Clear
  6.         .[a1:b1] = Array("¤é´Á", "¬I¤u¶µ¥Ø")
  7.     End With
  8.     With Sheets("¤u§@ªí1")
  9.         Set Rng(1) = .Range("B6", "B" & .[A6].End(xlDown).Row).Resize(, .[A1].End(xlToRight).Column - 1).SpecialCells(xlCellTypeConstants, 1)
  10.         ' ***   .SpecialCells(xlCellTypeConstants, 1)   ¬O¼Æ¦rªºÀx¦s®æ  ***
  11.         For Each e In Rng(1)
  12.             M = Application.Match(.Cells(e.Row, 1).Text, Sheets("¤u§@ªí2").Columns(1), 0)
  13.             If IsError(M) Then                             'Match¤£¨ì                 '
  14.                 Set Rng(2) = Sheets("¤u§@ªí2").Range("A" & Rows.Count).End(xlUp).Offset(1)
  15.                 Rng(2) = .Cells(e.Row, 1).Text             'AÄ檺¤é´Á
  16.                 Rng(2).Cells(1, 2) = .Cells(1, e.Column)   '²Ä¤@¦Cªº¬I¤u¶µ¥Ø
  17.             Else
  18.                 Set Rng(2) = Sheets("¤u§@ªí2").Range("A" & M)   'Match¨ì ªº¦C¸¹
  19.                 Rng(2).Cells(1, 2) = Rng(2).Cells(1, 2) & "¡B" & .Cells(1, e.Column)
  20.             End If
  21.         Next
  22.     End With
  23. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ­n¤ñ½Ö§ó¨ü½Ö¡D¤£­n¤ñ½Ö§ó©È½Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD