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

¬°¦ó¦r¨åªºitem¾É¥X®É·|³ø¿ù(«¬ºA¤£²Å¦X)?

¬°¦ó¦r¨åªºitem¾É¥X®É·|³ø¿ù(«¬ºA¤£²Å¦X)?

¬°¦ó¦r¨å·|³ø¿ù.rar (167.77 KB) ¦r¨åªº¨Ï¥Î¬O¦b³o½×¾Â¾Ç¨ì,¯uªº«Ü¦n¥Î,³o¬O²Ä¤@¦¸¸I¨ì¦r¨å¾É¥X³ø¿ù,KEY­È¨S¦³°ÝÃD,¦ýITEM­È³ø¿ù,¤]¤£ª¾¹D­ì¦]¥X¦b¨º,¥u¦n¨D±Ï¤F.

­YµL¥²­n, ¾¨¶q¤£­n¨Ï¥Î Transpose,
¦æ¼Æ¤Ó¦h, ¦r¤¸¼Æ¤Ó¦h, ©Î¨ä¥¦­ì¦], ·|µo¥Í¤£¥i¹w´Áªº¿ù»~,
¤£¶û³Â·Ð, ¦A¦hÂà­ÓÅs:
Sub A·sDP§PÂ_()
CL = Application.Match("C/L", [a1:a300], 0)  'C/L©Ò¦b¦C¼Æ
CR2 = Application.Match("CUP PRINT", [a1:a100], 0)
D1 = Application.Match("D/P", [a1:a300], 0) + 2  'D/P¸ê®Æ°Ï­º¦C(¤£§t¼ÐÃD¦C)
D2 = Cells(CR2, 1).End(3).Row 'D/P¸ê®Æ°Ï¥½¦C
[I:AD].Clear
Ar = Range(Cells(D1, 1), Cells(D2, 9))
Set D = CreateObject("Scripting.Dictionary")
For x = 1 To UBound(Ar)  '±NOS¸ê®Æ¤J°}¦C,item «h¥H"-"±NOS¦ê±µ
   D(Ar(x, 3)) = D(Ar(x, 3)) & IIf(D(Ar(x, 3)) = "", "", "-") & Ar(x, 2)
Next x
If D.Count = 0 Then Exit Sub

ReDim Br(1 To D.Count, 1)
For Each a In D.keys
    i = i + 1:  Br(i, 0) = a:  Br(i, 1) = D(a)
Next


Cells(D1, "J").Resize(D.Count, 2) = Br
End Sub


===================================

TOP

³oºØ¼gªk, ¦pªG¬Ý±oÀ´, ¥i°Ñ¦Ò:

Sub A·sDP§PÂ__2()
Dim Ar, Br, D, F1 As Range, F2 As Range, i&, N&, T$, U&, V
[J:K].ClearContents
Set F1 = [A:A].Find("D/P", Lookat:=xlWhole)(3, 1) '´M§ä"D/P"ªº¦ì¸m, ¨Ã¦V¤U²¾3®æ(§Y¸ê®Æªº¶}ÀY)
Set F2 = [A:A].Find("CUP PRINT").End(xlUp)(1, 3)  '´M§ä"CUP PRINT"ªº¦ì¸m, ¨Ã¦V¤W¨ú«DªÅ¦ì¸m, ¦A¦V¥k²¾3®æ
Ar = Range(F1, F2)
ReDim Br(1 To UBound(Ar), 1 To 2)
Set D = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(Ar)
    T = Ar(i, 3): If T = "" Then GoTo 99 '­YAMOUNT¬°ªÅ, ²¤¹L
    U = D(T) '¨ú±oAMOUNT¤w¦s¤J¦r¨åÀɪº¦ì¸m
    If U = 0 Then N = N + 1: U = N:  D(T) = N: Br(N, 1) = T '¦pªG©|¥¼¦s¤J¦r¨åÀÉ, N+1»¼¼W¦s¤J, ¨Ã±NAMOUNT­È©ñ¤JBr°}¦C
    Br(U, 2) = Replace(Trim(Br(U, 2) & " " & Ar(i, 2)), " ", "-") '¨Ì¾ÚU­Èªº¦ì¸m, ±NBÄæ¤å¦r¦s¤JBr
99: Next i
If N > 0 Then Cells(F1.Row, "J").Resize(N, 2) = Br
End Sub


==============================

TOP

¦^´_ 3# ­ã´£³¡ªL §Ú¤]²q¬O¦r¼Æ¤Óªø,´¿§R¥h¤@¦C´N¨S³ø¿ù,¦ýºô¤WGOOGLE¤]¨S§ä¨ìµª®×,ÁÂÁ­ã¤j¹©¤O¬Û§U,ÁÙ´£¨Ñ2ºØ¸Ñªk,§Ú·|¦n¦n¬ã¨s­ã¤jªº«ä¸ô¤Î·sªº§Þ¥©.

TOP

¦^´_ 4# ¤d·u´M
  1. Option Explicit
  2. Sub A·sDP§PÂ_()
  3.     Dim CL As Integer, CR2 As Integer, D1 As Integer, D2 As Integer, D As Object
  4.     Dim ar(), X As Integer, E As Variant
  5.     CL = Application.Match("C/L", [a1:a300], 0)  'C/L©Ò¦b¦C¼Æ
  6.     CR2 = Application.Match("CUP PRINT", [a1:a100], 0)
  7.     D1 = Application.Match("D/P", [a1:a300], 0) + 2  'D/P¸ê®Æ°Ï­º¦C(¤£§t¼ÐÃD¦C)
  8.     D2 = Cells(CR2, 1).End(3).Row 'D/P¸ê®Æ°Ï¥½¦C
  9.     [I:AD].Clear:
  10.     ar = Range(Cells(D1, 1), Cells(D2, 9))
  11.     Set D = CreateObject("Scripting.Dictionary")
  12.     For X = 1 To UBound(ar)  '±NOS¸ê®Æ¤J°}¦C,item «h¥H"-"±NOS¦ê±µ
  13.         D(ar(X, 3)) = D(ar(X, 3)) & "+" & ar(X, 2)
  14.     Next
  15.     If D.Count = 0 Then Exit Sub
  16.      '***§ï¾î©ñ¤£¨Ï¥Î>>Application.Transpose
  17.       Cells(D1, "J").Resize(, D.Count) = D.keys ''ª÷ÃBÄæ
  18.       Cells(D1 + 1, "j").Resize(, D.Count) = D.ItemS ''OSÄæ
  19.     'ª½©ñ **¦p°}¦C¤¤¤¸¯Àªº¦r¤¸¼Æ¦³>255 ¤¸¯À >> »Ý¤@¤@ªº¾É¥X
  20.      X = 1
  21.      For Each E In D.keys
  22.         Cells(D1 + 3, "j").Range("A" & X) = E
  23.         Cells(D1 + 3, "k").Range("A" & X) = D(E)
  24.         X = X + 1
  25.      Next
  26.      '*** '***¾î©ñ ¨Ï¥Î>>Application.Transpose*********************************
  27.       Cells(D1 + 3, "L").Resize(D.Count, 1) = Application.Transpose(D.keys) 'ª÷ÃBÄæ
  28.        '°}¦C¤¤¤¸¯Àªº¦r¤¸¼Æ¦³>255  '**¨Ï¥ÎApplication.Transpose·|µo¥Í¿ù»~
  29.        ar = D.ItemS
  30.       ar(0) = Mid(ar(0), 1, 256) 'OSÄæ -->³ø¿ù §ï¬° ar(0) = Mid(ar(0), 1, 255)¬Ý¬Ý
  31.       Cells(D1 + 3, "M").Resize(D.Count, 1) = Application.Transpose(ar) ''OSÄæ -->³ø¿ù
  32. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE ·PÁ¤j¤jÄÀºÃ,±z©M­ã¤jªºµ{¦¡½X³£¬O§Úªº¾Ç²ßªº³Ì¨Î¨Ó·½.

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD