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

­ì¸ê®Æ¦p¦ó¥Î¦r¨å©î¤À¡A¤J¤£³sÄòªºÄæ¦ì

ªüÀs¤j¡G
§Ö¦h¤F¡A0.34¬í
§Æ±æ¤ä«ù!

TOP

¦^´_ 21# s7659109

¤£¥Î¦r¨åª«¥ó
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Rng As Range, S As Variant, Ar(), Arr(), i As Long, ii As Integer
  4.     With Sheets("test")
  5.         Set Rng = .Range("b1:" & .Cells(1, Columns.Count).End(xlToLeft).Address) 'test¤WªºÄæ¦ì
  6.         Ar = Application.Transpose(Application.Transpose(Rng))
  7.         For i = 1 To Rng.Cells.Count
  8.             S = Application.Match(Rng(i), Sheets("data").Rows(1), 0)
  9.             Ar(i) = IIf(IsError(S), "", S)  '¸m¤Jtest¤WªºÄæ¦ì¦bdata¤WªºÄ渹
  10.         Next
  11.         Set Rng = .Range("a2:" & .Cells(Rows.Count, 1).End(xlUp).Address).Resize(, Rng.Columns.Count + 1)
  12.         Arr = Rng
  13.     End With
  14.     For i = 1 To UBound(Arr)
  15.         S = Application.Match(Arr(i, 1), Sheets("data").Columns(1), 0)
  16.         If Not IsError(S) Then    'test¤Wªº¾Ç¸¹¦bdata¤Wªº¦ì¸m
  17.             For ii = 1 To UBound(Ar) '¾É¤Jtest¤WªºÄæ¦ì¦bdata¤WªºÄ渹
  18.              If Ar(ii) <> "" Then Arr(i, ii + 1) = Sheets("data").Cells(S, Ar(ii))
  19.             Next
  20.         End If
  21.     Next
  22.     Rng.Value = Arr
  23. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD