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

¤T­Ó¤u§@ªí¦X¨Ö°ÝÃD

¦^´_ 1# aok669
   
  1. Sub Ex()
  2.     Dim D As Object, Sh As Worksheet, R As Range, i%, S$, ii
  3.     Set D = CreateObject("Scripting.Dictionary")
  4.     For Each Sh In Sheets
  5.         If Sh.Name <> "main" Then
  6.             With Sh
  7.                 i = .Range("a1").End(xlDown).Row
  8.                 For Each R In .Range("A3:A" & i & ",F3:F" & i)
  9.                     S = .Name & .Cells(1, R.Column) & R(1, 2)
  10.                     D(S) = Array(R(1, 3), R(1, 4), R(1, 5))
  11.                 Next
  12.             End With
  13.         End If
  14.     Next
  15.     With Sheets("MAIN")
  16.         i = .Range("a" & Rows.Count).End(xlUp).Row
  17.         For Each R In .Range("A3:A" & i)
  18.             For ii = 4 To 6
  19.                 S = .Cells(2, ii) & .[D1] & R
  20.                 If D.exists(S) Then
  21.                     If R(1, 2) = "" Then R(1, 2) = D(S)(1)
  22.                     If R(1, 3) = "" Then R(1, 3) = D(S)(2)
  23.                     R(1, ii) = D(S)(0)
  24.                 Else
  25.                     R(1, ii) = ""
  26.                 End If
  27.             Next
  28.             For ii = 9 To 11
  29.                 S = .Cells(2, ii) & .[i1] & R
  30.                 If D.exists(S) Then
  31.                     If R(1, 2) = "" Then R(1, 2) = D(S)(1)
  32.                     If R(1, 3) = "" Then R(1, 3) = D(S)(2)
  33.                     R(1, ii) = D(S)(0)
  34.                 Else
  35.                     R(1, ii) = ""
  36.                 End If
  37.             Next
  38.             If Application.Sum(R(1, 4).Resize(, 3), R(1, 9).Resize(, 3)) = 0 Then
  39.                 R(1, 2) = ""
  40.                 R(1, 3) = ""
  41.             End If
  42.         Next
  43.     End With
  44. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# aok669
ªÑ¥«§Ú¤£¤ÓÀ´½Ð°Ý,¹Ï¤@: 2409¤Í¹Fªº§ë«H½æ¶W-522 ,¦p¦óÅܦ¨ ¹Ï¤G:Âà¨ì¥~¸ê½æ¶W-522

TOP

        ÀR«ä¦Û¦b : ÁÀ¨¥¹³¤@¦·²±¶}ªºÂAªá¡A¥~ªí¬üÄR¡A¥Í©Rµu¼È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD