Board logo

¼ÐÃD: [µo°Ý] ¦p¦ó±NA,BÄæÂà´«¦¨¨S¦³ªÅ®æ¤Î­n¯S©w±Æ¦C¤§C,DÄæ [¥´¦L¥»­¶]

§@ªÌ: lcctno    ®É¶¡: 2015-8-16 18:36     ¼ÐÃD: ¦p¦ó±NA,BÄæÂà´«¦¨¨S¦³ªÅ®æ¤Î­n¯S©w±Æ¦C¤§C,DÄæ

¦p¹Ï¤Îªþ¥ó ¦p¦ó±NA,BÄæÂà´«¦¨¨S¦³ªÅ®æ¤Î­n¯S©w±Æ¦C¤§C,DÄæ

1. ¥h°£A,BÄ椺ªÅ¥Õ¤§®æ
2. CÄ椧­È¬O¥Ñ¤j¦Ü¤p DÄ椧­È¬O¦P¨B©óCÄæ(¸òµÛCÄæ²¾¦ì)
3. A,BÄ椧­È¬O­ÓÅÜ¼Æ ·|¨Ì¾Ú³]©w¤è¦¡¦Ó§ïÅÜ ¬GC,DÄ椧Á`®æ¼Æ¤]·|¸òµÛÅÜ
4. A,BÄ椧Á`®æ¼Æ ­Y¬OÅÜ¼Æ ·|³y¦¨¤£©ö¼gµ{¦¡ ¨º§Ú¥i¥H©T©w ¦ý³Ì¦n¤]¤¹³\A,BÄ椧Á`®æ¼Æ¥i¥H¬OÅܼÆ
5. ¦b¦¹¥ý·PÁ¤j®a¿ãÅDªº´£¨Ñ¤èªk À°¤p§Ì§Ú§¹¦¨¤£¥i¯àªº¥ô°È (§Ú¤wªá¶O¼Æ¤Ñªººë¯«»P®É¶¡ ¦ýÁÙ¬OµLªk§¹¦¨)


[attach]21730[/attach]


[attach]21731[/attach]
§@ªÌ: lcctno    ®É¶¡: 2015-8-16 21:33

§Ú§Ë¤F´X¤ÑÁÙ¬O¥d¦b³oùØ ¤@ª½¨S¦³¶i®i ¥i§_½Ð°ª¤â½ç±Ð


[attach]21732[/attach]


[attach]21733[/attach]
§@ªÌ: lpk187    ®É¶¡: 2015-8-16 22:25

¦^´_ 2# lcctno

§Aªº¼Æ¾Ú¥Î¤@¯ë±Æ§Ç´N¥i¥H°µ¨ì¤F°Ú¡I¤£À´¬°¤°»ò­n¼g¦¨µ{¦¡¡H
  1. Option Base 1
  2. Public Sub Ex()
  3. Set d = CreateObject("scripting.dictionary")
  4. aa = Cells(Rows.Count, 1).End(xlUp).Row
  5. bb = Cells(Rows.Count, 2).End(xlUp).Row
  6. Dim ar1()
  7. If aa < 2 Or bb < 2 Then Exit Sub
  8. If aa > bb Then
  9.     arr = Range("A3:B" & aa)
  10. Else
  11.     arr = Range("A3:B" & bb)
  12. End If

  13. For i = 1 To UBound(arr) - 1
  14.     For j = i + 1 To UBound(arr)
  15.         If arr(i, 2) > arr(j, 2) Then
  16.             r1 = arr(i, 1)
  17.             r2 = arr(i, 2)
  18.             arr(i, 1) = arr(j, 1)
  19.             arr(i, 2) = arr(j, 2)
  20.             arr(j, 1) = r1
  21.             arr(j, 2) = r2
  22.             
  23.         End If
  24.     Next
  25. Next

  26. For i = 1 To UBound(arr)
  27.     If arr(i, 1) <> "" And arr(i, 2) <> "" Then
  28.         n = n + 1
  29.         ReDim Preserve ar1(1 To 2, n)
  30.         ar1(1, n) = arr(i, 1)
  31.         ar1(2, n) = arr(i, 2)
  32.     End If
  33. Next
  34. [e3].Resize(UBound(ar1, 2), 2) = Application.Transpose(ar1)
  35. End Sub
½Æ»s¥N½X

§@ªÌ: lcctno    ®É¶¡: 2015-8-16 22:40

¦^´_ 3# lpk187
§Úª¾¹D"¥Î¤H¤u¬O«Ü®e©ö¹F¦¨ªº" ¦ý¥u­n°Ñ¼Æ¤@§ï´N±o­«·s¨Ó¹L ¥B¹ï«D¼gµ{¦¡¤§¤H ¸ò¥»«ÜÃø¨Ï¥Î ¬Æ¦Ü¤£·|¥¿½T¨Ï¥Î

«D±`·PÁ±zªº·N¨£¤Î¤½¦¡ §Ú¥ý¦¬¤U«Ý´ú¸Õ ­Y¦³°ÝÃD §Ú·|¦A¸ß°Ý±z ÁÂÁ±zªºÀ°§U
§@ªÌ: lpk187    ®É¶¡: 2015-8-16 22:50

¦^´_ 4# lcctno


    §Ú¤W­±µ{¦¡¦h¤F¤@¦æSet d = CreateObject("scripting.dictionary")½Ð¦Û¦æ§R°£¡I         
§@ªÌ: lcctno    ®É¶¡: 2015-8-16 23:25

¥»©«³Ì«á¥Ñ lcctno ©ó 2015-8-16 23:39 ½s¿è

¦^´_ 5# lpk187
"§Ú¤W­±µ{¦¡¦h¤F¤@¦æSet d = CreateObject("scripting.dictionary")½Ð¦Û¦æ§R°£¡I"

§R¤£§Rµ²ªG¬O¤@¼Ë  ¦Ñ¹ê»¡§Ú´X¥G¬Ý¤£À´±z´£¨Ñ¤§µ{¦¡¤º®eªº§t·N ¦ý§ÚÁÙª¾¹D±N "[e3].Resize(UBound(ar1, 2), 2) = Application.Transpose(ar1)" §ï¦¨[c3].Resize(UBound(ar1, 2), 2) = Application.Transpose(ar1) ¤~¯à¹ï¸¹¤J®y

·PÁ±z ¥i¹F¨ì§Ú­nªº¤º®e¤F
¦ý¦³¤@­Ó°ÝÃD ½Ð°Ý¯uªº¨S¿ìªk¤£¥ÎVBA¨Ó°õ¦æ¶Ü? ¦]¬°°Ñ¼Æ¤@§ïÅÜ ¼Æ­È¤£·|ª½±µ¸òµÛÅÜ ÁÙ±o¥²¶·­n¥[¤WÂI¤@­Ó«ö¶s ¤~¯à±o¨ì¥¿½T­È ½Ð°Ý¥i¦³¤èªk¥Î¤@¯ë¨ç¼Æ¨Ó¹F¦¨
³Ì«á°£¤FÁÂÁ±z ÁÙ¬O­n·PÁ±zªº¼ö¤ßÀ°§U
ps. §Ú¥Ø«e¦b¹Á¸Õ±N§Ú³o´X¦~¨Ó°µªº²Î­p¤ÀªR©Ò±oªºµ²ªG Âà´«¦¨¸êª÷°t¸mªºªí®æ ¥u­n²³æªº¿é¤J¥i§ë¸êªºÁ`ª÷ÃB ¤Î°t¦X²Ö¿nµo¥Í²vªº°Ñ»P®É¾÷ ¨ºªí®æ´N·|¦Û°Ê§i¶D±z¶Rªº°t¸m¤è¦¡
§Ú¤w¦Ñ¤F ³o¬O¬°§Úªº¨à¤l¼gªº ©È¥L¤£·|¥¿½Tªº¨Ï¥Î ©Ò¥H§Æ±æ¯àÅý¨S°ò¥»ª¾ÃѪº¥L¤]¯à®e©ö¨Ï¥Î
§Ú¤£¤Ó·|¼gµ{¦¡ ¦]¬°¾Ç®Õ§¹¥þ¨S¾Ç¹LExcell ¦ý§Úª¾¹D«ç»ò©óªÑ¥«ÁÈ¿ú(¬O¤@©wÁÈ) ©Ò¥H........
§@ªÌ: lcctno    ®É¶¡: 2015-8-17 08:54

¦^´_ 3# lpk187

§Ú¹J¨ì°ÝÃD¤F ­ìªþ¥ó¤WªºA,B,C,DÄæ ¦b§Ú¯u¹êªº¦ì¸m¬OT,U,V,W ­×§ï¤F¼Æ¤p®É «oµLªk­×§ï¦¨¥\  ¦A¦¸ªº³Â·Ð±z¤F
¥t¥~½Ð¦h¥[¤W¤@«ü¥O ©ó¾ã²z«á­n¶K¤W¤§«e ½Ð¥ý²MªÅ¸ÓÄæ¦ì¤§¥þ³¡¼Æ­È(­ì¤§C,DÄæ ²{¦bªºV,WÄæ) ÁÂÁ±z¤F



[attach]21736[/attach]



[attach]21737[/attach]
§@ªÌ: lpk187    ®É¶¡: 2015-8-17 12:00

¦^´_ 7# lcctno


         ¥i¥H¥ý½Ð±Ð§A¶Ü¡H¡A¦]¬°§A»¡"¦]¬°°Ñ¼Æ¤@§ïÅÜ ¼Æ­È¤£·|ª½±µ¸òµÛÅÜ"
¥i¥H§i¶D§Ú¦b­þ¸Ì·|§ïÅÜ¡H¤°»ò±¡ªp¤U§ïÅÜ¡H
VBA¨ä¹ê³£¥i¥H°µªº¥X¨Óªº¡I¨S¦³"¦]¬°°Ñ¼Æ¤@§ïÅÜ ¼Æ­È¤£·|ª½±µ¸òµÛÅÜ"ªº
¤]¤£¤@©w­n«ö¶sªº¡I
¥H¤U¦CÀɮפ¤ªºµ{¦¡¨Ó»¡¡A¥u­n§A§ïÅÜTÄ椤°£¤FT1©MT2¥~ªº¥ô¦óÀx¦s®æUÄæ©MVÄæ¤]·|¸òµÛ§ïÅܪº¡I
¦Ó¥B¤£¥Î«ö¶s¡A¥u­­Äæ§ïÅÜ®@¡I­Y§AªºSÄæ¤]·|Åܧ󪺸ܡA¤]¥i¥H¥[¤Jªº¡I

[attach]21739[/attach]
§@ªÌ: lcctno    ®É¶¡: 2015-8-17 12:35

¥»©«³Ì«á¥Ñ lcctno ©ó 2015-8-17 12:36 ½s¿è

¦^´_ 8# lpk187
¦pªþ¥ó ¥u¥Î¿ï¾Ü©Ê¶K¤W­È¤Î®æ¦¡¤Îµù¸Ñ
-½Ð¬ÝSheet2¥ª¤W¤è ¶À®æ¤º¤§­È¬Ò¥i¯à§ó§ï

  ÁÂÁ±z  ³Â·Ð±z¤F

¦³¨Ç¤p°ÝÃD
1.Sheet1¤º u3¤Îv3 ¬°¦ó·|ªÅ¥Õ
2. ªÑ»ù2.99          §ë¤Jª÷ÃB999 ,477
¨Ã¥¼³Q¥N¤Ju¤Îv¤º


        [attach]21740[/attach]
                 




   



[attach]21740[/attach]
§@ªÌ: lpk187    ®É¶¡: 2015-8-18 09:38

¦^´_ 9# lcctno


    [attach]21746[/attach]
§@ªÌ: lcctno    ®É¶¡: 2015-8-18 11:49

¥»©«³Ì«á¥Ñ lcctno ©ó 2015-8-18 11:50 ½s¿è

¦^´_ 10# lpk187

§Úµo²{Sheet1¤§­n¨Ï¥Î¤§Äæ¦ì¦³¿ù»~ ¬G¸É¤W¤F¤@¾ã±Æ¤§ªÅ¥ÕÄæ¦ì«á¤]¶i¥h­×§ï¥¨¶° ¦ý­n°õ¦æ¥¨¶°®É«o¬Ý¤£¨ì¥¨¶° ¬G¥u¦n¦Û¤v¶ÃCOPY °µ¤F¤@­Ó¥¨¶° ¦ý°õ¦æ°_¨Ó¨S¬Ý¨ì¦³¤°»ò°Ê§@
¥Ø«e½Ð±z¥H¥¨¶°ªº¤è¦¡¤U¥h¼g «Ý¥¿±`«á §Ú¦A½Ð±Ð±z¦p¦ó¯à·í°Ñ¼Æ ¤@§ïÅÜ µ²ªG¤]·|°¨¤W¸òµÛÅܪº¤èªk ÁÂÁ±z¤F




ªþ¤W§Ú¶Ã§ï¹LªºÀÉ®×


[attach]21747[/attach]
§@ªÌ: lpk187    ®É¶¡: 2015-8-18 15:13

¦^´_ 11# lcctno


    [attach]21755[/attach]


[attach]21756[/attach]
§@ªÌ: lcctno    ®É¶¡: 2015-8-18 17:28

¦^´_ 12# lpk187

¬°¦ó§Ú¦bVB¬Ýªº¨ìSheet1ªº¥¨¶° ¦ý­n°õ¦æ¥¨¶°®É«o¬Ý¤£¨ì ¦pªþ¹Ï
§Ú¬Ý±zÁÙ¬OÀ°§Ú§Ë­Ó¥i¥H¥Î ¤u¨ã/¥¨¶°/¥¨¶° µM«áÂI¿ï¸Ó¥¨¶°¨Ó"°õ¦æ"

²³æªº §Ú¥i¯à·| ¦ýµy·LÃøªº§Ú¯uªº¤£·| ³Â·Ð±z¥ý¥Î²³æ¤@ÂIªº¤è¦¡ ¦n¤è«K§Ú¤Jªù ¹ïªì¾Çªº§Ú §Ú¯uªº«Ü·Q¾Ç·| ¦ý¤J¤£¤Fªù ¯uªº«D±`ªºÁÂÁ±zªº¥Î¤ß±Ð¾É§Ú




[attach]21759[/attach]

[attach]21758[/attach]
§@ªÌ: lpk187    ®É¶¡: 2015-8-18 21:15

¦^´_ 13# lcctno

Private Sub Worksheet_Change(ByVal Target As Range)
End Sub
¬OÄÝ©ó"¤u§@ªí¨Æ¥ó"ªºµ{§Ç¬O¤£·|¦b¥¨¶°¤¤¥X²{¡A·|¦b¥¨¶°¤¤¥X²{ªº¥u¦³Module1¡BModule2... ©ÎªÌ¬Oµ{§Ç¥HPublic Sub  xxxx  ¤¤¤~·|¥X²{   
¦Ó¥HPrivate Sub xxx¶}ÀYªºµ{§Ç¤]¤£·|¥X²{¦b¥¨¶°Ã¯¤¤¡A³o¸Ì½Ð°Ñ¦ÒVBA»¡©ú¡A"Sub ³¯­z¦¡"
Worksheet_Change¤u§@ªí¨Æ¥ó­Y­n¦b¨ä¥Lªº¤u§@ªí¤¤¨Ï¥Î¥²¶·­n¾ã­Ó½Æ»s¹L¥h¡A¥¦¬OÄÝ©ó¨p¦³»â°ìªºµ{§Ç¡A¥H¨Æ¥ó¨ÓIJµo¡A¦Ó¤£¬O§Q¥Î«ö¶s¡A³o¸Ì½Ð°Ñ¦ÒVBA¦Ò»¡©ú¤¤ªºWorksheet.Change ¨Æ¥óªº
§@ªÌ: lcctno    ®É¶¡: 2015-8-18 21:52

¦^´_ 14# lpk187

§Ú¬Oªì¾ÇªÌ ¥Ø«e¨S¦³¯à¤O±N¤§Âà´«¦¨§Ú¯à¨Ï¥Î¤§¥¨¶°
¥B§Ú¦³¹Á¸Õ±N±zªþ¤WªºÀÉ®×T,U¦æ¤§¼Æ­È§ïÅÜ ¦ýV,W¦æ¤º¤§­È¨ÃµLªk¦Û¦æÅÜ§ó ¨º¤Ï¦Ó³y¦¨§Ú¤£´±¨Ï¥Î¸Ó¼Æ¾Ú
§Ú¬Ý§ÚÁÙ¬O¥Î³Ì°ò¥»ªº¤H¤u¸ê®Æ±Æ§Ç«á½Æ»s¶K¤W ©Î¥i¨Ï¥Î¿ý»s·s¥¨¶°ªº¤è¦¡¨Ó³B²z §K±o§Ú¥i¯à°µ¥Õ¤u ÁÙ¥i¯àÃa¤F§Ú­ì¨Ó¥i±o¨ìªº¥¿½T²Î­p ¨º±N¥i¯à·|¿éªº¤£©ú¤£¥Õ
±z»¡©O? ¨º¬O¿úªº¾Ôª§ ½Ð¤£­n©Ç§Ú¬D­ç
ÁöµM§Ú¨S¯à©¯¹Bªº±o¨ì§¹¬üªº¸Ñµª ¦ý§Úª¾¹D±z¬O¥Î¤ßªº·QÀ°§Ú¸Ñ¨M°ÝÃD ¯uªº§ÚÁÙ¬O«Ü·PÁ±zªºÀ°§U
§@ªÌ: lcctno    ®É¶¡: 2015-8-18 22:20

¦^´_ 14# lpk187
§Ú¥Ø«e¬O¦b·Q¿ìªk±N§Ú¹L¥h¥Î¶Ç²Îªº°ò¥»»yªk(Àɮׯuªº«Ü¤j ¦³¤@Àɤw770mbs ¥BÁÙ¤£¬O§Ú¯uªº³ßÅwªº¤ÀªR¤è¦¡) ¶}±Ò¶O®É §ïÅܤº®e¤§data Àx¦s®É¶¡¤]«Ü¶O®É ©Ò¥H¤~·Q¹Á¸Õ¨Ï¥Î¥¨¶°ªº¤è¦¡¨Ó¼g  ¦ýÁ`¤£¯à¬°¤F´î¤ÖÀÉ®×Åé¿n(mbs©Î³\§ï¤ÑÅܦ¨gbs) ¦Ó±o¨ì¨S¥i«H«×ªº¸ê®Æ§a! ¸ôÁö»· ¦ýºCºC¨«©Î³\ÁÙ¬O¥i¯à·|¥­¦wªº¨ì¹F¥Øªº¦a§a! ¯uªºÁÙ¬O«Ü·PÁ±z ­Y±z§ï¤Ñ·Q¤¶¤JªÑ¥«¬ÛÃö¤§²£ª« §Ú¥i´£¨Ñ§ÚªºÁÈ¿ú¤ßªk
³o¬O¨ä¤@"·Qªk¤£§ïÅÜ °µªk·íµM¤]¤£·|ÅÜ ¨º¿é®a«ç»ò·|Åܦ¨Ä¹®a"
§@ªÌ: ­ã´£³¡ªL    ®É¶¡: 2015-8-22 18:27

­Y¤£¥Îvba¡A¥B¬°°ÊºA¼Æ¾Ú¡A¥[­Ó»²§UÄæ§Y¥i¡G
¢ë¢²¤½¦¡¡G¤U©Ô¦Ü¸ê®Æ§Àµ§
=IF(OR(A3="",B3=""),"",A3*10^8+ROW())
¡@
¢ì¢²¤½¦¡¡G¥k©Ô¢í¢²¦A¤U¨ê
=IF(ROW(D1)>COUNT($c:$c),"",INDEX(A:A,RIGHT(LARGE($c:$c,ROW(D1)),5)))
¡@




Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)