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

[µo°Ý] ¦h±ø¥ó¿z¿ï&ListBox

¦^´_ 122# starbox520

TOP

¦^´_ 118# starbox520
¸Õ¸Õ¬Ý¡I
  1. Private Sub CommandButton2_Click()
  2.     Dim Arr As Variant, Brr As Variant, aa As Variant, i&, j&, x$, Myr&
  3.     Dim d As Object, t As Variant

  4.     Set d = CreateObject("Scripting.Dictionary")
  5.    
  6.    
  7.     '  ¤ñ¹ï "TR±Æ¾÷&²£¥X" ¦Ç¦âÄæ¦ì "E" (Customer)¡B "F" (Package)¡B "G" (Bodysize)¡B "H" (L/C) ¤ñ¹ï
  8.     '  "¶q¤j¥¼±Æ¾÷" §ä¨ì¤@¼Ëªº¡A ¨q¤W "TR±Æ¾÷&²£¥X" ªº "B" Äæ (¾÷¥x½s¸¹) ¦P¤@¦Cªº "¾÷¥x½s¸¹"¡C
  9.     With Sheets("TR±Æ¾÷&²£¥X")
  10.         Arr = .[A1].CurrentRegion.Value
  11.    
  12.         For i = 4 To (UBound(Arr) - 3) Step 5
  13.             If Not IsError(Arr(i, 5)) Then   '& "|" & Arr(i, 6) & "|" & Arr(i, 7) & "|" & Arr(i, 8)
  14.                  x = Arr(i, 5) & "|" & Arr(i, 6) & "|" & Arr(i, 7) & "|" & Arr(i, 8)
  15.                  d(x) = IIf(IsEmpty(d(x)), CStr(i), d(x) & "," & CStr(i))
  16.             End If
  17.         Next
  18.     End With

  19.     With Sheets("¶q¤j¥¼±Æ¾÷")
  20.         Brr = .[A1].CurrentRegion
  21.         
  22.         For i = 2 To UBound(Brr)
  23.             x = Brr(i, 1) & "|" & Brr(i, 2) & "|" & Brr(i, 3) & "|" & Brr(i, 4)
  24.             
  25.             If d.exists(x) Then
  26.                 t = d(x)
  27.                
  28.                 If InStr(t, ",") Then
  29.                     aa = Split(t, ",")
  30.                     
  31.                     For j = 0 To UBound(aa)
  32.                         .Cells(i, 9 + j) = Arr(aa(j), 2)
  33.                     Next
  34.                 Else
  35.                     .Cells(i, 9) = Arr(t, 2)
  36.                 End If
  37.             End If
  38.         Next
  39.         
  40.         '  ¥D­n·Q³]¸m "H" (¼Æ¶q) Äæ ¼Æ¶q¥Ñ¤j¦Ü¤p¡A³oÃä¥H¿ý»s¥¨¶°¨Ï¥Î
  41.         .AutoFilter.Sort.SortFields.Clear
  42.         .AutoFilter.Sort.SortFields.Add Key:=Range( _
  43.                 "H1:H500"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
  44.                 xlSortNormal
  45.         
  46.         With .AutoFilter.Sort
  47.             .Header = xlYes
  48.             .MatchCase = False
  49.             .Orientation = xlTopToBottom
  50.             .SortMethod = xlPinYin
  51.             .Apply
  52.         End With
  53.     End With
  54. End Sub
½Æ»s¥N½X

TOP

¦^´_ 120# c_c_lai


    ³o°ÝÃD¦û¤F¦n¦hªº¼Ó¼h  
    ·d¨ì§Ú³s§Ú¦^´_ªº©«³£¬Ý¤£¨ì¤FXD
    C¤j¦³¨ä¥L¥i¥H¦^´_ªº¦a¤è¶Ü~
    §Ú­Ì³B²z§¹¥áµ²ªG¤W¨Ó¦n¹³¤ñ¸û¤£¦ûªÅ¶¡...

TOP

¦^´_ 120# c_c_lai

ªþÀɤ¤§Ú¦³¥[¤J³o­Ó«ö¶s
¦pªG¤ñ¹ï¬Û¦Pªº¸Ü
§Ú·|¨q¨º¤@Ä檺¾÷¥x"½s¸¹"
¤f»~°ÕQ0Q

  1. Private Sub CommandButton2_Click()
  2. Sheets("¶q¤j¥¼±Æ¾÷").Select
  3. Dim Arr, i&, Brr, aa, j&, x$, Myr&

  4. Dim d, k, t

  5. Set d = CreateObject("Scripting.Dictionary")

  6. Sheets("¶q¤j¥¼±Æ¾÷").Activate
  7. '¤ñ¹ï"TR±Æ¾÷&²£¥X" ¦Ç¦âÄæ¦ì"E""F""G""H"¤ñ¹ï"¶q¤j¥¼±Æ¾÷"§ä¨ì¤@¼Ëªº¡A¨q¤W"TR±Æ¾÷&²£¥X"ªº"B"Äæ¦P¤@¦Cªº¾÷¥x½s¸¹
  8. With Sheets("TR±Æ¾÷&²£¥X")

  9.     Myr = .Cells(.Rows.Count, 12).End(xlUp).Row

  10.     Arr = .Range("a1:p" & Myr)

  11. End With

  12. For i = 4 To UBound(Arr) Step 5

  13.     If Not IsError(Arr(i, 5)) Then   '& "|" & Arr(i, 6) & "|" & Arr(i, 7) & "|" & Arr(i, 8)

  14.     x = Arr(i, 5) & "|" & Arr(i, 6) & "|" & Arr(i, 7) & "|" & Arr(i, 8)

  15.     d(x) = d(x) & i & ","

  16.     End If

  17. Next

  18. Brr = [a1].CurrentRegion
  19.    
  20. For i = 2 To UBound(Brr) Step 5

  21.    x = Brr(i, 1) & "|" & Brr(i, 2) & "|" & Brr(i, 3) & "|" & Brr(i, 4)

  22.   If d.exists(x) Then

  23.       t = d(x)

  24.         t = Left(t, Len(t) - 1)

  25.        If InStr(t, ",") Then

  26.            aa = Split(t, ",")

  27.            For j = 0 To UBound(aa)

  28.                Cells(i, 9 + j) = Arr(aa(j), 2)

  29.            Next
  30.       Else

  31.            Cells(i, 9) = Arr(t, 2)

  32.        End If

  33.     End If

  34. Next
  35. '¥D­n·Q³]¸m"H"Äæ¼Æ¶q¥Ñ¤j¦Ü¤p¡A³oÃä¥H¿ý»s¥¨¶°¨Ï¥Î
  36. ActiveWorkbook.Worksheets("¶q¤j¥¼±Æ¾÷").AutoFilter.Sort.SortFields.Clear
  37.     ActiveWorkbook.Worksheets("¶q¤j¥¼±Æ¾÷").AutoFilter.Sort.SortFields.Add Key:=Range( _
  38.         "H1:H500"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
  39.         xlSortNormal
  40.     With ActiveWorkbook.Worksheets("¶q¤j¥¼±Æ¾÷").AutoFilter.Sort
  41.         .Header = xlYes
  42.         .MatchCase = False
  43.         .Orientation = xlTopToBottom
  44.         .SortMethod = xlPinYin
  45.         .Apply
  46.     End With
  47. End Sub
½Æ»s¥N½X

TOP

¦^´_ 119# c_c_lai


    ´«§Ú²´ªá¤F§Ú¨S¬Ý¨ì³o¦æ«¢«¢...
    ­è­è´ú¸Õ¹L¤F!!
    ¨S¿ù«¢«¢~

TOP

¦^´_ 118# starbox520
¤S¡B"¶q¤j¥¼±Æ¾÷" ªº¾÷¥x¸¹½X ¬O±q¨º¸Ì«_¥X¨Óªº¡H

TOP

¦^´_ 118# starbox520
¨º #116 ¤W¦³Ãö BGA¡BQFN¡BQFP ªºµ{¦¡³¡¤À¡A
©p´ú¸Õªºµ²ªG¬O¤£¬O¦p§A©ÒÄ@¡H

TOP

¦^´_ 117# c_c_lai


    ³oÃ䪺³¡¤À¬O§Ú  ¨Ò¦p§A¬Ý¨ìSQH191
    ¥L¤£¥i¯à¥X²{¦b¨âµ§¼Æ¾Ú¤W­±~
    ¦pªG¨Ï¥ÎªÌ¤â´Ý¡A¤@ª½ÂI«ö¶sªº¸Ü
    ´N·|¥X²{³oºØBug
    ¦ý§Ú¸Õ¹Ldebug­ì¦]¦n¹³¬O¥X¦b§Ú«á­±IJKLÄæ  ¤£·|¥ýClear±¼~"~
    ¾É­P¨C¦¸«ö¶s«ö¤U¥h¤ñ¹ïªº®É­Ô
    ·|¥X²{¿ù¶Ã«¢«¢
    §Ú¦³­Ó·Qªk´N¬O§Ú¦bArrangeMent³oÃä
  1. If N = 0 Then Exit Sub
  2.     With Sheets("¤u§@ªí2")
  3.    .[A2].Resize(N, 8) = Brr
  4.   
  5. End With
  6. If N = 0 Then Exit Sub
  7.     With Sheets("¶q¤j¥¼±Æ¾÷")
  8.    .[A2].Resize(N, 8) = Brr
  9.    End With
  10. End Sub
½Æ»s¥N½X
¶q¤j¥¼±Æ¾÷³¡¤À
§ï¦¨   .[A2].Resize(N, 12) = Brr
³o¼Ë¨C¦¸´N·|§ó·s¨ì«á­±³o4¦æ
¦b«ö¤U§Ú³]­pªº"¶q¤j¥¼±Æ¾÷"«ö¶s
¦ü¥G´N¤ñ¸û¤£·|¥X¿ù
¤£¹L³o¥u¬O§Úªº·QªkXD...
¦]¬°§Úµo²{³o¼Ë§ïªº¸Ü«á­±·|Åܦ¨¶]"N/A"¥X¨Ó


©Ò¥HC¤jÀ´§ÚBGA.QFN.QFP  ³o3ºØ¯S®íªºª¬ªp°µ§PÂ_
¦A»¡¤°»ò¤F¶Ü«¢«¢

TOP

¦^´_ 101# starbox520

TOP

¦^´_ 111# starbox520
  1.                 Select Case cts
  2.                     Case 3      '  ²Ä 3 ºØ¿z¿ï¤è¦¡¡G TR±Æ¾÷&²£¥X    E F G H   (¤u§@ªí2        A B C D)
  3.                         '  tf = arSh2(ct2, 1) = Adt_Rng.Offset(, -1) And arSh2(ct2, 2) = Adt_Rng.Value And arSh2(ct2, 3) = Adt_Rng.Offset(, 1) And arSh2(ct2, 4) = Adt_Rng.Offset(, 2)
  4.                         tf = arSh2(ct2, 1) = Adt_Rng.Offset(, -1) And Right(arSh2(ct2, 2), 3) = Right(Adt_Rng.Value, 3) And arSh2(ct2, 3) = Adt_Rng.Offset(, 1) And arSh2(ct2, 4) = Adt_Rng.Offset(, 2)
  5.                     Case 4      '  ²Ä 4 ºØ¿z¿ï¤è¦¡¡G TR±Æ¾÷&²£¥X      F G H   (¤u§@ªí2          B C D)
  6.                         '  tf = arSh2(ct2, 2) = Adt_Rng.Value And arSh2(ct2, 3) = Adt_Rng.Offset(, 1) And arSh2(ct2, 4) = Adt_Rng.Offset(, 2)
  7.                         tf = Right(arSh2(ct2, 2), 3) = Right(Adt_Rng.Value, 3) And arSh2(ct2, 3) = Adt_Rng.Offset(, 1) And arSh2(ct2, 4) = Adt_Rng.Offset(, 2)
  8.                     Case 5      '  ²Ä 5 ºØ¿z¿ï¤è¦¡¡G TR±Æ¾÷&²£¥X      F G     (¤u§@ªí2          B C  )
  9.                         '  tf = arSh2(ct2, 2) = Adt_Rng.Value And arSh2(ct2, 3) = Adt_Rng.Offset(, 1)
  10.                         tf = Right(arSh2(ct2, 2), 3) = Right(Adt_Rng.Value, 3) And arSh2(ct2, 3) = Adt_Rng.Offset(, 1)
  11.                 End Select
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : §Ú­Ì­n°µ¦nªÀ·|ªºÀô«O¡A¤]­n°µ¦n¤º¤ßªºÀô«O¡C
ªð¦^¦Cªí ¤W¤@¥DÃD