- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ 1# 317
´£¨Ñ©p°Ñ¦Ò»P´ú¸Õ¡A±Æ§Ç¹ï¶H¬° ©±¾Q¦WºÙ¡BÃþ§O¡B°Ó«~¦WºÙ¡B¾P°âª÷ÃBµ¥¶¶§Ç¡C- Option Base 1
- Option Explicit
- ' -------------------------------------------
- ' A3 = ªÅ¥ÕÄæ
- ' B3 = §Ç¸¹
- ' C3 = ©±¾Q¦W¡G ¤¤¤s°Ï¡B¥j«F°Ï µ¥
- ' * D3 = ©±¾Q¦WºÙ ±Æ§Ç¤è¦¡¡G (»¼¼W)
- ' * E3 = Ãþ§O ±Æ§Ç¤è¦¡¡G (»¼¼W)
- ' * F3 = °Ó«~¦WºÙ ±Æ§Ç¤è¦¡¡G (»¼¼W)
- ' G3 = ³æ»ù
- ' H3 = ¼Æ¶q
- ' * I3 = ¾P°âª÷ÃB ±Æ§Ç¤è¦¡¡G (»¼´î)
- ' J3 = ³Æµù
- ' -------------------------------------------
- Sub Sorting_Sample()
- Dim sortKey As Variant
- Dim sortSeq As Variant
- Dim i As Long
-
- sortKey = Array("D", "E", "F", "I")
- sortSeq = Array("A", "A", "A", "D")
-
- For i = UBound(sortKey ) To 1 Step -1
- Range("B3").CurrentRegion.Sort _
- Key1:=Cells(3, sortKey (i)), _
- Order1:=IIf(sortSeq(i) = "A", _
- xlAscending, xlDescending), _
- Header:=xlYes, Orientation:=xlTopToBottom
- Next i
- End Sub
½Æ»s¥N½X |
|