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

[µo°Ý] °}¦C¸ê®Æ¨ÌÄæ¦ì©ïÀY¦WºÙ¶i¦æÂ\©ñ

¥»©«³Ì«á¥Ñ luhpro ©ó 2016-4-16 04:17 ½s¿è

¦^´_ 1# art00083303

  1. Sub NN()
  2.   Dim iI%, iJ%, iCol%
  3.   Dim lRow&
  4.   Dim aR()
  5.   Dim vD
  6.   
  7.   [B22:I100].Clear ' ²M±¼¤W¤@¦¸ªº¸ê®Æ
  8.   
  9.   Set vD = CreateObject("Scripting.Dictionary")
  10.   iCol = 4
  11.   While Cells(21, iCol) <> ""
  12.     vD(CStr(Cells(21, iCol))) = iCol ' vD(¶µ¥Ø¦WºÙ) = Äæ¦ì¸¹½X
  13.     iCol = iCol + 1
  14.   Wend
  15.   
  16.   lRow = 22
  17.   For iI = 2 To 14 Step 6 ' 3 ­Óªí®æ
  18.     For iJ = 1 To 3
  19.       With Cells(lRow, 2)
  20.         .NumberFormat = "yyyy/m/d"
  21.         .Value = Cells(iI + iJ, 2) ' DATE
  22.       End With
  23.       
  24.       With Cells(lRow, 3)
  25.         .NumberFormat = "hh:mm"
  26.         .Value = Cells(iI + iJ, 3) ' TIME
  27.       End With
  28.       
  29.       iCol = 4
  30.       While Cells(iI + iJ, iCol) <> "" ' HTM »P ¨ä¥L
  31.          With Cells(lRow, vD(CStr(Cells(iI, iCol))))
  32.            .Value = Cells(iI + iJ, iCol)
  33.            .Interior.ColorIndex = Cells(iI + iJ, iCol).Interior.ColorIndex ' ³]©w©³¦â
  34.          End With
  35.          iCol = iCol + 1
  36.       Wend
  37.       lRow = lRow + 1
  38.     Next
  39.   Next
  40. End Sub
½Æ»s¥N½X
©ñ.zip (7.12 KB)

³Ì«á, ¦A©IÆ~¤@¤U,
­Y¸ê®Æ¸û¦h¥BµL³W«ß©Ê,
½Ð¶}¦êªº¤H¶¶«K´£¨Ñ½d¨ÒÀÉ,
¥i¥[§Ö¤j®a¦^¤åªº³t«×. (¸`¬Ù Key ½d¨ÒÀɸê®Æªº®É¶¡)

TOP

¦^´_ 4# art00083303
¨º´N¦b§ì¨ú¸ê®Æ®É, ¤@¨Ö«Ø¥ßµ²ªG¼ÐÃDÄd : (·íµM, ¶¶§Ç·|Åܦ¨¨Ì§ì¨ú¥ý«á±Æ¦C)

  1. Private Sub cbMerge_Click()
  2.   Dim iI%, iJ%, iSCol%, iTCol%
  3.   Dim lRow&
  4.   Dim aR()
  5.   Dim vD
  6.   
  7.   Rows("21:" & Rows.Count).Clear ' ²M±¼¤W¤@¦¸ªº¸ê®Æ(§t¼ÐÃDÄd)
  8.   
  9.   Set vD = CreateObject("Scripting.Dictionary")
  10.   
  11.   Cells(21, 2) = "DATE"
  12.   Cells(21, 3) = "TIME"
  13.   
  14.   lRow = 22
  15.   iTCol = 4
  16.   For iI = 2 To 14 Step 6 '3 ­Óªí®æ
  17.     iSCol = 4
  18.     While Cells(iI, iSCol) <> "" ' Àˬd¼ÐÃDÄd
  19.       If Not (vD.Exists(CStr(Cells(iI, iSCol)))) Then
  20.         vD(CStr(Cells(iI, iSCol))) = iTCol
  21.         Cells(21, iTCol) = Cells(iI, iSCol)
  22.         iTCol = iTCol + 1
  23.       End If
  24.       iSCol = iSCol + 1
  25.     Wend
  26.    
  27.     For iJ = 1 To 3
  28.       With Cells(lRow, 2)
  29.         .NumberFormat = "yyyy/m/d"
  30.         .Value = Cells(iI + iJ, 2) ' DATE
  31.       End With
  32.       
  33.       With Cells(lRow, 3)
  34.         .NumberFormat = "hh:mm"
  35.         .Value = Cells(iI + iJ, 3) ' TIME
  36.       End With
  37.       
  38.       iSCol = 4
  39.       While Cells(iI + iJ, iSCol) <> ""
  40.         With Cells(lRow, vD(CStr(Cells(iI, iSCol))))
  41.           .Value = Cells(iI + iJ, iSCol)
  42.           .Interior.ColorIndex = Cells(iI + iJ, iSCol).Interior.ColorIndex ' ½Æ»s©³¦â
  43.         End With
  44.         iSCol = iSCol + 1
  45.       Wend
  46.       lRow = lRow + 1
  47.     Next
  48.   Next
  49. End Sub
½Æ»s¥N½X
©ñ-a.zip (11.18 KB)

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD