[µo°Ý]±N¨â°}¦C¨Ì¶¶§Ç¦X¨Ö°ÝÃD
- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 254
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-23
|
¦^´_ 16# asus103 - Sub Dic_Sort()
- Dim C()
- Set d = CreateObject("Scripting.Dictionary") '
- Set d1 = CreateObject("Scripting.Dictionary") '¦P¯Á¤Þ¶µ¥Ø¼Æ¶qp¼Æ¾¹
- '(ª`·N)¤u§@ªí1¸ò¤u§@ªí2ªº¸ê®Æ¦C¼Æn¬Û¦P
- a = Sheets(1).Range("A1").CurrentRegion: B = Sheets(2).Range("A1").CurrentRegion '¼g¤JA¡BB°}¦C¤º®e
- For Each y In Array(a, B) '¥H°j°é¶¶§ÇŪ¤JA¡BB°}¦C¨ì¦r¨åª«¥ó
- For i = LBound(y, 2) To UBound(y, 2)
- d(y(1, i) + d1(y(1, i)) * 0.1) = Application.Transpose(Application.Index(y, , i)) '¦]¬°¯Á¤Þȳ£¬O¾ã¼Æ¡A©Ò¥H¯Á¤ÞÈ¥[p¼Æªº0.1¿·í¦¨·s¯Á¤ÞÈ¡AÁקK»P¨ä¥L¯Á¤ÞÈ«½Æ¡A¹ïÀ³2¦CªºÈ
- d1(y(1, i)) = d1(y(1, i)) + 1 '¦P¯Á¤ÞÈp¼Æ
- Next
- Next
- Do Until d.Count = 0 '¶i¦æ°j°é¡Aª½¨ì¦r¨å¤º®e¼Æ¶q¬°0¸õ¥X°j°é
- ky = Application.Small(d.keys, 1) '±o¨ì¯Á¤ÞÈ°}¦C¤¤³Ì¤pÈ
- 'ky = Application.Min(d.keys) '±o¨ì¯Á¤ÞÈ°}¦C¤¤³Ì¤pÈ¡A¥ç¥i¨Ï¥ÎMIN¨ç¼Æ
- ReDim Preserve C(s)
- C(s) = d(ky) '±N³Ì¤pȪº¤º®e¦s¤J°}¦C
- s = s + 1
- d.Remove ky '²¾°£¦r¨å¤¤³Ì¤pȪº¶µ¥Ø¡A¦¹®É¦r¨å¤º®e¼Æ¶q·|´î¤Ö1Ó
- Loop
- Sheets(3).[A1].Resize(UBound(a, 1), s) = Application.Transpose(C) '쥻C°}¦C¥iµø¬°s¦C(°}¦CAªº¦C¼Æ)Äæ¡A©Ò¥HÂà¸m«á¦¨¬°(°}¦CAªº¦C¼Æ)¦CsÄæ¡A¼g¤J¤u§@ªí
- Set d = Nothing 'ÄÀ©ñª«¥ó
- Set d1 = Nothing 'ÄÀ©ñª«¥ó
- End Sub
½Æ»s¥N½X
Array_Sort.zip (11.64 KB)
|
|
¾Ç®üµL²P_¤£®¢¤U°Ý
|
|
|
|
|
- ©«¤l
- 77
- ¥DÃD
- 11
- ºëµØ
- 0
- ¿n¤À
- 118
- ÂI¦W
- 0
- §@·~¨t²Î
- winXP
- ³nÅ骩¥»
- office2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-12-24
- ³Ì«áµn¿ý
- 2011-3-2
|
·PÁÂHsieh¡BFAlonso¨â¦ì¤j¤j
§Ú±q³oÓ°Q½×ªº¹Lµ{¤¤¦¬Ã¬«Ü¦h
·|¦Aªá®É¶¡¦n¦n§l¦¬¨ä¤¤ºëµØ
¦Ó¥Bµ{¦¡½Xȱo¨åÂáA¥H«á¥²µM©|¦³¾÷·|¥Î¨ì
·PÁ¦A¤T |
|
ASUS
|
|
|
|
|
- ©«¤l
- 1446
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1470
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-10-21
|
¦^´_ 21# Hsieh
ÁÂÁ«e½ú,ÁÂÁ½׾Â
«á¾ÇÂǦ¹©«½m²ß°}¦C¦b¦r¨å¸Ì§]¦R¤§¶¡½s¿è°}¦CÈ»P Àx¦s®æ¦P¦r¤¸¼Æ¾î¦V±Æ§Ç,½m²ß¤è®×¦p¤U
½Ð«e½úÌ«ü±Ð
¸ê®Æªí(¤u§@ªí1):
¸ê®Æªí(¤u§@ªí2):
µ²ªGªí(¤u§@ªí3):
Option Explicit
Sub TEST_2()
Application.ScreenUpdating = False
Dim Y, N&, i&, j&, A, C%
Set Y = CreateObject("Scripting.Dictionary")
Sheets(3).UsedRange.Clear
For i = 1 To 2
Y("ªí" & i) = Sheets(i).Range("A1").CurrentRegion: A = Y("ªí" & i)
Y(i & "/R") = UBound(A): Y(i & "/C") = UBound(A, 2)
For j = 1 To Y(i & "/C")
N = N + 1: A(1, j) = Format(A(1, j), "000") & "|" & Format(N, "000")
Next
Y("ªí" & i) = A
Next
Sheets(3).[A1].Resize(Y("1/R"), Y("1/C")) = Y("ªí1")
Sheets(3).[A1].Item(1, Y("1/C") + 1).Resize(Y("2/R"), Y("2/C")) = Y("ªí2")
With Sheets(3).UsedRange
.Sort Key1:=.Item(1), Order1:=xlAscending, Header:=xlNo, _
Orientation:=xlLeftToRight
Intersect([1:1], .Cells).Replace "|*", "", Lookat:=xlPart
End With
Set Y = Nothing
End Sub |
|
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y
|
|
|
|
|