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

[µo°Ý]±N¨â°}¦C¨Ì¶¶§Ç¦X¨Ö°ÝÃD

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-1-15 11:58 ½s¿è

¦^´_ 13# FAlonso
­Y¦Ò¼{¯Á¤Þ­È·|­«½Æªº±¡§Î(²Ä¤@¦C¬Û¦P¡A¦ý²Ä¤G¦C¹ïÀ³­È¤£¦P)
¦p¹Ïªº¸ê®Æ
±z·|¦p¦ó¸Ñ¨M?
Array_Sort.zip (10.21 KB)
  1. Sub Dic_Sort()
  2. Dim C()
  3. Set d = CreateObject("Scripting.Dictionary")
  4. Set d1 = CreateObject("Scripting.Dictionary")
  5. A = Sheets(1).[A1:J2]: B = Sheets(2).[A1:J2]
  6. For Each y In Array(A, B)
  7.    For i = LBound(y, 2) To UBound(y, 2)
  8.      d(y(1, i) + d1(y(1, i)) * 0.1) = Array(y(1, i), y(2, i))
  9.      d1(y(1, i)) = d1(y(1, i)) + 1
  10.    Next
  11. Next
  12. Do Until d.Count = 0
  13.    ky = Application.Small(d.keys, 1)
  14.    ReDim Preserve C(s)
  15.    C(s) = d(ky)
  16.    s = s + 1
  17.    d.Remove ky
  18. Loop
  19. Sheets(3).[A1].Resize(2, s) = Application.Transpose(C)
  20. Set d = Nothing
  21. Set d1 = Nothing
  22. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 1# asus103
  1. Sub merge_rank()
  2. Dim myobject As Object
  3. Dim myrange As Range
  4. Dim i As Integer

  5. Set myobject = CreateObject("scripting.dictionary")

  6. For i = 1 To 2
  7. With Worksheets("sheet" & i)
  8. For Each myrange In .Range(.[a1], .[a1].End(xlToRight))
  9. myobject(myrange.Value) = myrange.Offset(1).Value
  10. Next
  11. End With
  12. Next

  13. With Sheet3
  14. For i = 1 To myobject.Count
  15. .Cells(1, i).Value = Application.Small(myobject.keys, i)
  16. .Cells(2, i).Value = myobject.Item(Application.Small(myobject.keys, i))
  17. Next
  18. End With

  19. Set myobject = Nothing

  20. End Sub
½Æ»s¥N½X
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 10# Hsieh
·PÁ±zHsieh¤j¤j

«D±`·P¿E±zªº¨ó§U
§Ú·Q§Ú¤j·§»Ý­nªá¤@¬q®É¶¡¨Ó®ø¤Æ³Ìªñ±z±ÐªºªF¦è

ÁÂÁ±z
ASUS

TOP

[ª©¥DºÞ²z¯d¨¥]
  • Hsieh(2011-1-13 23:15): 10#¤w¼Ð¥Üµù¸Ñ

Hsieh¤j¤j±z¦n
¹ï¤£°_¡A§Ú¬Ý¤£¤jÀ´
¥i¥H³Â·Ð±z¸ÑÄÀ¤@¤U¶Ü?

§Ú¦pªG­n¥Î¨ì§Úªºµ{¦¡¤¤
¬O¤£¬O­n´¡¤J1¡B3¡B5¦æ©O?
²Ä1¦æ¬O§_¤@©w±o¦b¾ã­Ó¼Ò²Õªº³Ì¤W¤è©O?
ASUS

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-1-13 22:26 ½s¿è

¦^´_ 9# asus103
¤@¯ë¼Ò²Õ
  1. Declare Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long) '«Å§iAPIªºSLEEP¨ç¼Æ
  2. Sub nn()
  3. t = Timer '¶}©l­p®É
  4. For i = 1 To 10
  5.   Sleep 500  '©µ¿ð500/1000¬í
  6. Next
  7. MsgBox "©µ¿ð" & Timer - t & "¬í"  "¨C¦¸©µ¿ð0.5¬í¡A¤Q¦¸©µ¿ð«á¦@©µ¿ð?¬í
  8. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ asus103 ©ó 2011-1-13 20:34 ½s¿è

¦^´_ 8# Hsieh
·PÁ±zHsieh¤j¤j
¤S´£¨Ñ§Ú¥t¤@­Ó«ä¦Ò¤è¦¡

¥i¥H¥t¥~¦A½Ð±Ð±z¦³Ãö"Delay"ªº¥Îªk¶Ü?
VBA»¡©ú§Ú¬Ý¤£¬ÆÀ´
¤£ª¾¹D¦p¦ó±±¨î©µ¿ð®É¶¡¡A
¦pªG¦b¤@¦^°é¤¤¨C¤@¦¸©µ¿ð0.5¬í¡A¨ä»yªk¬°¦ó
ÁÂÁÂ
ASUS

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-1-13 18:45 ½s¿è

¦^´_ 7# asus103
  1. Sub yy() '®ðªw±Æ§Ç
  2. Dim Ar(), Ay()
  3. A = [B1:D2]: B = [F1:I2]
  4. For Each y In Array(A, B)
  5. For i = LBound(y, 2) To UBound(y, 2)
  6. ReDim Preserve Ar(s)
  7. ReDim Preserve Ay(s)
  8.   Ar(s) = y(1, i)
  9.   Ay(s) = y(2, i)
  10.   s = s + 1
  11. Next
  12. Next
  13. For i = 0 To UBound(Ar)
  14.     For j = 0 To UBound(Ar) - 1
  15.        If Ar(j + 1) < Ar(j) Then '»¼¼W
  16.      'If Ar(j + 1) > Ar(j) Then  '»¼´î
  17.       temp = Ar(j)
  18.       temp1 = Ay(j)
  19.       Ar(j) = Ar(j + 1)
  20.       Ar(j + 1) = temp
  21.       Ay(j) = Ay(j + 1)
  22.       Ay(j + 1) = temp1
  23.       
  24.     End If
  25.     Next
  26. Next
  27. [B15].Resize(, s) = Ar
  28. [B16].Resize(, s) = Ay
  29. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# Hsieh
·PÁ±zHsieh¤j¤j
§Ú´ú¸Õ¹L¤Fwinxp¡Boffice2007¯à¥¿±`¤u§@
¸ò¤å¦rÀɶ¡ªº¤¬°Ê¬O§Ú¤§«e¤ñ¸û¤Ö¸I¡A¦ý¥¿¦n¬O§Ú¦Û¤v³W¹º¤U¤@¶¥¬qªº¾Ç²ß¥Ø¼Ð
§Ú»Ý­n¦hªá¤@ÂI®É¶¡¥h¬ã¨s¥L¡A­Y¦³°ÝÃD¦A¦V±z½Ð±Ð
·PÁ±z
ASUS

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-1-13 22:28 ½s¿è

¦^´_ 5# asus103
  1. Sub ex()
  2. Dim C()
  3. Open "test.txt" For Output As #1 '²£¥Í¼È¦sÀÉ
  4. A = [B1:D2]: B = [F1:I2]
  5. For i = LBound(A, 2) To UBound(A, 2)
  6. Print #1, A(1, i) & "," & A(2, i)
  7. Next
  8. For i = LBound(B, 2) To UBound(B, 2)
  9. Print #1, B(1, i) & "," & B(2, i)
  10. Next
  11. Close #1
  12. Shell "sort / " & "test.txt" & " /o " & "temp.txt" '²£¥Í±Æ§Ç¼È¦sÀÉ
  13. '°»´úª½¨ìÀɮײ£¥Í,¦AÄ~Äò«á­±ªº°Ê§@
  14. While Dir("temp.txt") = ""
  15. Wend
  16. Open "temp.txt" For Input As #1
  17. Do Until EOF(1)
  18. Line Input #1, mystr
  19. ReDim Preserve C(s)
  20. C(s) = Split(mystr, ",")
  21. s = s + 1
  22. Loop
  23. Close #1
  24. Kill "test.txt" '§R°£¼È¦sÀÉ
  25. Kill "temp.txt" '§R°£±Æ§Ç¼È¦sÀÉ
  26. [B12].Resize(2, s) = Application.Transpose(C)
  27. End Sub
½Æ»s¥N½X
sort«ü¥O¬OWindows­ì¥»´N¦³ªºDOS«ü¥O¡A¥Î©ó±Æ§Ç¯Â¤å¦rÀÉ¡C
¥H¤Wµ{¦¡³q¹LWindows7+Excel2010´ú¸Õ¡F
­Y¦b§Aªº¹q¸£°õ¦æ¦³»~¡A½Ð½T»{§Aªº¹q¸£¸Ì¦³ sort.exe ³o­Ó°õ¦æÀÉ¡C
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh
Hsieh¤j¤j±z¦n
¹ï¤£°_¡A¬O§ÚÃ㤣¹F·N
ªþ¤W½d¨ÒÀÉ
·PÁ±z
Book1.rar (12.24 KB)
ASUS

TOP

        ÀR«ä¦Û¦b : ¯à·F¤£·F¡A¤£¦p­W·F¹ê·F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD