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

[µo°Ý] ¦p¦ó¦C¥X«ü©w­«½Æ¦¸¼Æ¥H¤ºªº¸ê®Æ©O?

[µo°Ý] ¦p¦ó¦C¥X«ü©w­«½Æ¦¸¼Æ¥H¤ºªº¸ê®Æ©O?

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2019/3/28 08:03): ªþÀɤ¤¨S¬Ý¨ìSQL»yªk

1.»Ý­n¦C¥X ¶µ¥Ø¦WºÙ ­«½Æ¥X²{¦¸¼Æ¬O¦b«ü©wªº¼Æ¦r¤ºªº¸ê®Æ

¥Ø«e¬O¥ÎSQL»yªk ¦C¥X ¸s²Õ­pºâ¦³­þ¨Ç«~¶µ²Å¦X,¦b¥Ñ³o¨Ç¸ê®Æ¥h¶i¦æ¬d¸ß
¦ý»yªk¦êªº±K±K³Â³Â....Åܱo«ÜÃøºûÅ@
¦C¥X_«ü©w­«½Æ¦¸¼Æ¥H¤ºªº¸ê®Æ.rar (8.53 KB)

  1. Sub zz()
  2. Dim d As Object, a, k, t, n&
  3. Set d = CreateObject("scripting.dictionary")
  4. a = [a1].CurrentRegion.Value
  5. For i = 1 To UBound(a)
  6.     k = a(i, 2)
  7.     If Not d.exists(k) Then
  8.         d(k) = Array("|" & i, a(i, 3))
  9.     Else
  10.         t = d(k)
  11.         t = Array(t(0) & "|" & i, t(1) + a(i, 3))
  12.         d(k) = t
  13.     End If
  14. Next
  15. t = d.items
  16. For i = 0 To UBound(t)
  17.     k = Split(t(i)(0), "|")
  18.     If UBound(k) < 6 Then
  19.         For ii = 1 To UBound(k)
  20.             n = n + 1
  21.             For j = 1 To UBound(a, 2)
  22.                 a(n, j) = a(k(ii), j)
  23.             Next
  24.         Next
  25.     End If
  26. Next
  27. [h2].Resize(n, j - 1) = a
  28. End Sub
½Æ»s¥N½X

TOP

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

TOP

¦^´_ 2# ikboy


    ·PÁÂ~²Å¦X»Ý¨D
·Q½Ð°Ý "|" ³o­Óªº¥Î·N¬O?

TOP

¦^´_ 3# hcm19522
·PÁÂ~ÁöµM¦³¹F¨ì¥Ø¼Ð
¦ý¦]¬°¼Æ¶q¦³¼Æ¸U¦C,¨Ï¥Î¨ç¼Æ·|¹Bºâ«Ü¤[


ÁÙ¬O·PÁÂÀ°¦£¤F!

TOP

¦^´_ 4# starry1314


    ¬O¤À¹j²Å¡C

TOP

Sub TEST()
Dim Arr, xD, N&, i&, j%
Arr = Range([A1], [B65536].End(xlUp)(1, 2))
Set xD = CreateObject("Scripting.Dictionary")
For i = 2 To UBound(Arr)
    xD(Arr(i, 2) & "") = xD(Arr(i, 2) & "") + 1
Next
For i = 2 To UBound(Arr)
    If xD(Arr(i, 2) & "") > 5 Then GoTo 101
    N = N + 1
    For j = 1 To 3: Arr(N + 1, j) = Arr(i, j): Next
101: Next
If N > 0 Then [H2].Resize(N + 1, 3) = Arr
End Sub

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD