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

½Ð°Ý¦p¦ó±N­q³æ­ì©l¸ê®ÆÂন»Ý­nªº?

½Ð°Ý¦p¦ó±N­q³æ­ì©l¸ê®ÆÂন»Ý­nªº?



¤j®a¦n¡A³o´X¤Ñ¬d¤F³\¦h¸ê®Æ¡AÁÙ¬O¤£¯à±N¸ê®ÆÂà¦n¡C·Q½Ð°Ý¦p¦ó±NA:Eªº¸ê®Æ¡A¤À§OÂà´«¦¨H:J ¥H¤ÎM¨ìV©O? (¦pªG¤j®a¦b¤½¦¡³]©w¤W¡A¦³§ó¦nªº±Æ¦C¤è¦¡¡A¤]¥i¥Hª½±µ½Õ¾ã)

Áٷб¡¤j®a¨ó§U¡AÁÂÁ¡C


ªþ¤WEXCELªºÀɮסG
¬¡­¶Ã¯1.zip (7.13 KB)

google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

  1. Sub zz()
  2. Dim d As Object, a, k, t, b(), n&, m&, kk, tt
  3. Set d = CreateObject("scripting.dictionary")
  4. a = Range("a2:e" & [e1048576].End(3).Row)
  5. For i = 1 To UBound(a)
  6.     d("@" & a(i, 2)) = ""
  7.     k = a(i, 2) & "|" & a(i, 3)
  8.     If Not d.exists(k) Then
  9.         d(k) = Array(a(i, 4), a(i, 5), a(i, 5))
  10.     Else
  11.         t = d(k)
  12.         t(0) = t(0) & "|" & a(i, 4)
  13.         t(1) = t(1) & "|" & a(i, 5)
  14.         t(2) = t(2) + a(i, 5)
  15.         d(k) = t
  16.     End If
  17. Next
  18. k = Filter(d.keys, "@")
  19. ReDim b(1 To UBound(a), 1 To UBound(k) + 1)
  20. For j = 0 To UBound(k)
  21.     b(1, j + 1) = Mid(k(j), 2)
  22.     d.Remove (k(j))
  23.     kk = Filter(d.keys, b(1, j + 1) & "|")
  24.     For ii = 0 To UBound(kk)
  25.         t = d(kk(ii))
  26.         b(ii + 2, j + 1) = Split(kk(ii), "|")(1) & ":" & t(2)
  27.         m = m + 1
  28.         n = IIf(ii + 2 > n, ii + 2, n)
  29.     Next
  30. Next
  31. [h7].Resize(n, UBound(b, 2)) = b
  32. k = d.keys
  33. ReDim b(1 To UBound(a), 1 To m * 2): j = 0
  34. For i = 0 To UBound(k)
  35.     kk = Split(k(i), "|")
  36.     t = d(k(i))
  37.     j = j + 1
  38.     b(1, j) = kk(0)
  39.     b(2, j) = kk(1) & ":" & t(2)
  40.     For jj = 0 To 1
  41.         tt = Split(t(jj), "|")
  42.         For jjj = 0 To UBound(tt)
  43.             b(3 + jjj, j + jj) = tt(jjj)
  44.         Next
  45.     Next
  46.     n = IIf(jjj + 2 > n, jjj + 3, n)
  47.     j = j + 1
  48. Next
  49. [m7].Resize(n, UBound(b, 2)) = b
  50. Set d = Nothing
  51. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# ikboy


ikboy¤j¤j¡A

ÁÂÁ±zªº¨ó§U¡C

¦b¾Þ§@¥¨¶°ªº¹Lµ{¤¤¡A¦³¤@¨Ç¤p°ÝÃD¡A·Q½Ð±Ð±z¡G
1. ·|¥X²{¦pÀɮשҥܪºN/A
2. ±N²Ä¤­¦æªº¸ê®Æ½Æ»s¨ì²Ä¤»¦æ¡B²Ä¤C¦æ¡A·|¥X²{°õ¦æ¶¥¬q¿ù»~'9' °}¦C¯Á¤Þ¶W¥X½d³ò¡C
°»¿ù·|¦b¡Gb(3 + jjj, j + jj) = tt(jjj)

·Q½Ð°Ý¦p¦ó¸Ñ¨M©O¡AÁÂÁ±zªº¨ó§U¡C

¬¡­¶Ã¯1 (2).zip (16.06 KB)

TOP

  1. Sub zz()
  2. Dim d As Object, a, k, t, b(), n&, m&, kk, tt
  3. Set d = CreateObject("scripting.dictionary")
  4. a = Range("a2:e" & [e1048576].End(3).Row)
  5. For i = 1 To UBound(a)
  6.     d("@" & a(i, 2)) = ""
  7.     k = a(i, 2) & "|" & a(i, 3)
  8.     If Not d.exists(k) Then
  9.         d(k) = Array(a(i, 4), a(i, 5), a(i, 5))
  10.     Else
  11.         t = d(k)
  12.         t(0) = t(0) & "|" & a(i, 4)
  13.         t(1) = t(1) & "|" & a(i, 5)
  14.         t(2) = t(2) + a(i, 5)
  15.         d(k) = t
  16.     End If
  17. Next
  18. k = Filter(d.keys, "@")
  19. ReDim b(1 To UBound(a), 1 To UBound(k) + 1)
  20. For j = 0 To UBound(k)
  21.     b(1, j + 1) = Mid(k(j), 2)
  22.     d.Remove (k(j))
  23.     kk = Filter(d.keys, b(1, j + 1) & "|")
  24.     For ii = 0 To UBound(kk)
  25.         t = d(kk(ii))
  26.         b(ii + 2, j + 1) = Split(kk(ii), "|")(1) & ":" & t(2)
  27.         m = m + 1
  28.         n = IIf(ii + 2 > n, ii + 2, n)
  29.     Next
  30. Next
  31. [h1].Resize(n, UBound(b, 2)) = b
  32. k = d.keys
  33. ReDim b(1 To UBound(a), 1 To m * 2): j = 0
  34. For i = 0 To UBound(k)
  35.     kk = Split(k(i), "|")
  36.     t = d(k(i))
  37.     j = j + 1
  38.     b(1, j) = kk(0)
  39.     b(2, j) = kk(1) & ":" & t(2)
  40.     For jj = 0 To 1
  41.         tt = Split(t(jj), "|")
  42.         For jjj = 0 To UBound(tt)
  43.             b(3 + jjj, j + jj) = tt(jjj)
  44.             Cells(3 + jjj, j + jj + 12) = tt(jjj)
  45.         Next
  46.         n = IIf(UBound(tt) + 3 > n, UBound(tt) + 3, n)
  47.     Next
  48.     j = j + 1
  49. Next
  50. [m1].Resize(n, UBound(b, 2)) = b
  51. Set d = Nothing
  52. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# ikboy

ikboy¤j¤j±z¦n¡A
·PÁ±z´£¨Ñ·sªº¥¨¶°¡A¦ý¸g¹ê´ú«á¡AÁÙ¬O·|¦³¿ù»~¡C¦p¤U¹Ï¡G



¤£¦n·N«ä¡A­Y±z¤è«K¡AÁٽг·бz¨ó§U´£¨Ñ¤@¨Ç·Qªk¡AÁÂÁ±z¡C

TOP

[§å¸¹]¤]°µ¥h­«ÂЦA¥[Á`:
Xl0000365.rar (19.34 KB)

TOP

¦^´_ 7# ­ã´£³¡ªL


ÁÂÁ­㴣³¡ªL¤j¤j´£¨Ñªº¥¨¶°¼gªk¡A¦b¦¹·Q½Ð±Ð±z¡G
¦pªG·QÅý¨â­Óªí®æ¤À§O±qJ1©MJ10ªº¦ì¸m¶}©lÅã¥Üªº¸Ü¡A
"
[H1].Resize(MaxRa + 1, MaxCa) = Arr
[H1].Cells(1, MaxCa + 3).Resize(MaxRb + 2, MaxCb) = Brr
"
§Ú§ï¤F¤W­±ªº¼gªk¡AÅܦ¨¦p¤U¡G
"
[J1].Resize(MaxRa + 1, MaxCa) = Arr
[J10].Cells(1, MaxCa - 2).Resize(MaxRb + 2, MaxCb) = Brr
"

¦ý§Úµo²{¡A¦pªG¸ê®Æ¤@Åܰʪº¸Ü¡A²Ä¤G­Óªí®æ¤£¤@©w·|±qJ10¶}©lÅã¥Ü¡C

·Q½Ð°Ý­ã´£³¡ªL¤j¤j¡A¸Ó¦p¦ó½Õ¾ã©O? ÁÂÁ±z¡C

TOP

¦^´_ 8# gaishutsusuru

[J1].Resize(MaxRa + 1, MaxCa) = Arr
[J1].Cells(MaxRa + 4, 1).Resize(MaxRb + 2, MaxCb) = Brr

¤W¤UªÅ¨â¦æ~~

TOP

¦^´_ 9# ­ã´£³¡ªL


ÁÂÁ±zªº¦^ÂСC
¦b¸g¹L¹ê´ú«á¡Aµo²{²Ä¤G­Óªí®æ¬O·|ÀHµÛ²Ä¤@­Óªí®æªº¤º®e¨ÓªÅ¨â¦æ¡C

¤£¦n·N«ä¡A·Q½Ð°Ý±z¡A¥i¥HÅý²Ä¤G­Óªí®æ©T©w³£±qJ10¶}©l¶Ü¡H

¦A«ô°U±z©âªÅ¨ó§U·Qªk¡AÁÂÁ±z¡C

TOP

        ÀR«ä¦Û¦b : ¤H­n¦Û·R¡A¤~¯à·R´¶¤Ñ¤Uªº¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD