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

[µo°Ý] §Q¥Î¤U©Ô¦¡¿ï³æ¿ï¨ú¸ê®Æ¡A¨Ã¶i¦æ¶i¶¥¿z¿ï

[µo°Ý] §Q¥Î¤U©Ô¦¡¿ï³æ¿ï¨ú¸ê®Æ¡A¨Ã¶i¦æ¶i¶¥¿z¿ï

¦U¦ì¤j¤j­Ì:

·Q½Ð°Ý¤@¤U¡A§Ú·Q¥Î¤u§@ªí1ªº³o¨Ç¸ê®Æ¡A§Q¥Î"Âå®v¥N½X"³o­ÓÄæ¦ì°µ¥X¤U©Ô¦¡¿ï³æ¡A
¿ï¥X¤§«á§Æ±æ§e²{ª¬ºA¦p¤u§@ªí2¤@¼Ë¡A¨Ã¥BBÄæ¦ì»PEÄæ¦ì¶i¦æ¶i¶¥¿z¿ï(¤£­«½Æ)¡A¿ï¨ú¦bG»PIÄæ¦ì¤W¡A²ÄJÄæ¦ì¬O­pºâ¤½¦¡¡A³o¨Ç§@ªk¦p¦ó¥ÎVBA§e²{?

¥Ñ©ó¹ê»Ú¸ê®Æ¸û¬°Ãe¤j¡A¦p¥Î¤â°Ê¿z¿ï¤uµ{¯E¤j¡A¬G§Æ±æª½±µ¥ÎVBAªº»yªk¥h°õ¦æ¥¦¡A§Æ±æ¦U¦ì°ª¤â­ÌÀ°¦£!!! ·P¿E¤£ºÉ~~~

¤W¶Ç¥Î.zip (8.95 KB)

¥»©«³Ì«á¥Ñ Hsieh ©ó 2014-7-25 10:59 ½s¿è

¦^´_ 1# Duck

¤£­«½Æ©w¸q¬O§_B&D¤£­«½Æ?
play.gif
¦pªG¬Oªº¸Ü
´¡¤J¦Û­qªí³æ¡A¥¬¸m¤@­Ó¤U©Ô²M³æ
ªí³æ¼Ò²Õ¤¤µ{¦¡½X¦p¤U
  1. Private Sub ComboBox1_Change()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. With ¤u§@ªí2
  4. Set Rng = ¤u§@ªí2.[A1]
  5. .[A:E].Clear
  6. With ¤u§@ªí1
  7.    With .Range("A1").CurrentRegion
  8.       .AutoFilter 4, ComboBox1
  9.       .SpecialCells(xlCellTypeVisible).Copy Rng
  10.       .AutoFilter
  11.    End With
  12. End With
  13. mystr = "=COUNTIF(C5,RC9)/(COUNTA(C7)-1)"
  14. For Each a In .Range(.[B2], .[B1].End(xlDown))
  15.     d(a & a.Offset(, 3)) = Array(a, "", a.Offset(, 3))
  16. Next
  17. .Range("G1").CurrentRegion.Offset(1).ClearContents
  18. .[G2].Resize(d.Count, 3) = Application.Transpose(Application.Transpose(d.items))
  19. .[J2].Resize(d.Count, 1).FormulaR1C1 = mystr
  20. .[H2] = d.Count
  21. End With
  22. Unload Me
  23. End Sub

  24. Private Sub UserForm_Initialize()
  25. Set d = CreateObject("Scripting.Dictionary")
  26. With ¤u§@ªí1
  27.    For Each a In .Range(.[D2], .[D2].End(xlDown))
  28.       d(a.Text) = ""
  29.    Next
  30. End With
  31. ComboBox1.List = d.keys
  32. End Sub
½Æ»s¥N½X
¤W¶Ç¥Î.zip (28.34 KB)
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

·PÁ°ª¤âªºÁ¸§U¡A¦ý¤£¦n·N«ä§Ú¨S§â°ÝÃD»¡²M·¡¡A§Ú¬O§Æ±æ²ÄBÄæ¦ì¿ï¨ú¤£­«´_¦ÜGÄæ¦ì¡A²ÄEÄæ¦ì¿ï¨ú¤£­«´_¦ÜJÄæ¦ì¡A¬O¥¦­Ì¦U¦Û¿ï¨ú¤£­«½Æ¡A©êºp~ »y·N¨S»¡¦n....

¥t¥~¡A§Ú·Q¦A½Ð±Ð¤@¤U¡A¤£ª¾¹D»yªk¬O§_¥i¥H°õ¦æ»¡¡A§Ú·Q¥ý¦bAÄæ¦ì¿ï¨ú¤£­«½Æ¦ÜLÄæ¦ì¡A«hMÄæ¦ì¥i¥H¥h¦Û°Ê­pºâ¥X¡ALÄæ¦ìªº¨C­Ó¤@¶µ¥Ø¥L­Ì¦bBÄæ¦ì¤£­«½Æ¥X²{ªº¦¸¼Æ¬O´X¦¸?!

¦p¤U¹Ï©Ò¥Ü¡A§Ú¥i¥H¦bLÄæ¦ì¸Ìªº"19168"³o­Ó¶µ¥Ø¤¤­pºâ¥X¥L¤À§O¦³2013061011226©M2013061011470³o¨âµ§¬ö¿ý¡A¬G¬O¦bMÄæ¦ì­pºâ¥X²{¤F2¦¸¡A¤£ª¾¬O§_¥i¥H°õ¦æ?



·Ð½Ð°ª¤â¯à¸Ñ±Ï¦b¤U...·P¿E¤£ºÉ~~

¥¼©R¦W.png (23.23 KB)

¥¼©R¦W.png

TOP

¦^´_ 2# Hsieh

©êºp~¥Ñ©ó§Ñ°O®×¦^ÂСA¬G¦b­«·sµo¤@½g~


·PÁ°ª¤âªºÁ¸§U¡A¦ý¤£¦n·N«ä§Ú¨S§â°ÝÃD»¡²M·¡¡A§Ú¬O§Æ±æ²ÄBÄæ¦ì¿ï¨ú¤£­«´_¦ÜGÄæ¦ì¡A²ÄEÄæ¦ì¿ï¨ú¤£­«´_¦ÜJÄæ¦ì¡A¬O¥¦­Ì¦U¦Û¿ï¨ú¤£­«½Æ¡A©êºp~ »y·N¨S»¡¦n....


¥t¥~¡A§Ú·Q¦A½Ð±Ð¤@¤U¡A¤£ª¾¹D»yªk¬O§_¥i¥H°õ¦æ»¡¡A§Ú·Q¥ý¦bAÄæ¦ì¿ï¨ú¤£­«½Æ¦ÜLÄæ¦ì¡A«hMÄæ¦ì¥i¥H¥h¦Û°Ê­pºâ¥X¡ALÄæ¦ìªº¨C­Ó¤@¶µ¥Ø¥L­Ì¦bBÄæ¦ì¤£­«½Æ¥X²{ªº¦¸¼Æ¬O´X¦¸?!

¦p¤U¹Ï©Ò¥Ü¡A§Ú¥i¥H¦bLÄæ¦ì¸Ìªº"19168"³o­Ó¶µ¥Ø¤¤­pºâ¥X¥L¤À§O¦³2013061011226©M2013061011470³o¨âµ§¬ö¿ý¡A¬G¬O¦bMÄæ¦ì­pºâ¥X²{¤F2¦¸¡A¤£ª¾¬O§_¥i¥H°õ¦æ?



·Ð½Ð°ª¤â¯à¸Ñ±Ï¦b¤U...·P¿E¤£ºÉ~~

¥¼©R¦W.png (23.23 KB)

¥¼©R¦W.png

TOP

¦^´_ 2# Hsieh


    Hsieh ±z¦n:

¤£ª¾§Úªº°ÝÃD¬O§_´y­z¦³Åý§A¤£²M·¡ªº¦a¤è¶Ü? ­þ­Ó³¡¤À¤£ÁA¸Ñ¡A§Ú¥i¥H¦A¥[¥H»¡©ú¡A§Æ±æ§A¯àÀ°À°§Ú³o­Óvbaªì¾ÇªÌ~ ¸U¤À·P¿E :)

TOP

¦^´_ 2# Hsieh


±z¦n¡A³o­Óµ{¦¡¶]¥X¨Ó¤u§@ªí2ªºGÄæ¦ì»PIÄæ¦ìÁÙ¬O"¦U¦Û"ÁÙ¬O·|¥X²{­«½Æªº±¡§Î¡A½Ð°Ý»yªk­n¦p¦ó­×§ï¡A¤~·|¥¦­ÌÄæ¦ì¬O¥X²{¦U¦Û¤£­«½Æªº±¡ªp??


¸÷¨D¤j®vÀ°¦£~~~~:dizzy:

TOP

¦^´_ 6# Duck
  1. Private Sub ComboBox1_Change()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. Set d1 = CreateObject("Scripting.Dictionary")
  4. Set d2 = CreateObject("Scripting.Dictionary")
  5. Set d3 = CreateObject("Scripting.Dictionary")
  6. d2("CHT_IDX") = "BÄ椣­«½Æ¼Æ" 'L:MªºÄæ¦ì¦WºÙ"
  7. d3("CHT_IDX") = "BÄ椣­«½Æ¼Æ"
  8. With ¤u§@ªí2
  9. Set Rng = ¤u§@ªí2.[A1]
  10. .[A:E].ClearContents '²M°£¤§«e¿z¿ïµ²ªG
  11. With ¤u§@ªí1
  12.    With .Range("A1").CurrentRegion
  13.       .AutoFilter 4, ComboBox1 '¨Ì¾Ú¤U©Ô¿ï³æ¿z¿ï¸ê®Æ
  14.       .SpecialCells(xlCellTypeVisible).Copy Rng '±N¿z¿ïµ²ªG½Æ»s¨ì²Ä¤G¤u§@ªí
  15.       .AutoFilter '¨ú®ø¿z¿ï
  16.    End With
  17. End With
  18. mystr = "=COUNTIF(C5,RC9)/(COUNTA(C7)-1)" 'JÄ椽¦¡
  19. For Each a In .Range(.[B2], .[B1].End(xlDown)) 'BÄæ¸ê®Æ°µ°j°é
  20.     d(a.Value) = "" 'Àx¦sDATESEQ¤£­«½Æ²M³æ
  21.     d1(a.Offset(, 3).Value) = "" 'Àx¦sPRICE_NAME¤£­«½Æ²M³æ
  22.     d3(a.Offset(, -1).Value) = _
  23.     IIf(InStr(d3(a.Offset(, -1).Value), a) = 0, d3(a.Offset(, -1).Value) & ";" & a, d3(a.Offset(, -1).Value)) '¥HAÄ欰¯Á¤Þ¡A­Y¥¼§tBÄæ¦r¦ê¡A«h¥H¤À¸¹;³sµ²BÄæ¦r¦ê
  24.     d2(a.Offset(, -1).Value) = UBound(Split(d3(a.Offset(, -1).Value), ";")) '¥H¤À¸¹¤Á³Î¦r¦ê¡A­pºâ¥X°}¦C¤¸¯À¼Æ¶q¡A§Y¬°¦PCHT_IDXªº¤£­«½ÆBÄæ¼Æ¶q
  25. Next
  26. .Range("G1").CurrentRegion.Offset(1).ClearContents
  27. .[L:M].ClearContents '²M°£L:MÄæ
  28. '¼g¤JG:MÄæ
  29. .[G2].Resize(d.Count, 1) = Application.Transpose(d.Keys)
  30. .[I2].Resize(d1.Count, 1) = Application.Transpose(d1.Keys)
  31. .[L1].Resize(d3.Count, 1) = Application.Transpose(d3.Keys)
  32. .[M1].Resize(d2.Count, 1) = Application.Transpose(d2.items)
  33. .[J2].Resize(d1.Count, 1).FormulaR1C1 = mystr
  34. .[H2] = d.Count
  35. End With
  36. Unload Me '¨ø¸üªí³æ
  37. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 7# Hsieh


    ·PÁ°ª¤âªºÁ¸§U! ¥i¥H¦¨¥\°õ¦æ¤F~~~ ÁÂÁÂ!!!

TOP

thanks ,¤S¾Ç²ß¨ì¤F

TOP

ÁÂÁª©¥D¡A³o¥÷¸ê®Æ¤]Åý§Ú¸Ñ¨M§Úªº°ÝÃD¨Ã¥B¾Ç¨ì«Ü¦h¡I¡I¡I¡I

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD