- ©«¤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
|
¦^´_ 2# Hsieh
¦^´_ 1# PJChen
¤£¦n·N«ä¡AɥΠHsieh ª©¤jªº»yªkµy¥[×¹¢¡G- Sub Test()
- Dim ans As Variant
-
- ans = RankData(Range("B2:B11"), True)
- MsgBox "³Ì¤jȬ° " & ans
- ans = RankData(Range("B2:B11"), False)
- MsgBox "³Ì¤pȬ° " & ans
- End Sub
- Function RankData(Rng As Range, asc As Boolean) As Variant
- Dim rn As Variant
-
- For Each rn In Rng
- If asc = True Then
- RankData = IIf(RankData = "", rn, IIf(rn > RankData, rn, RankData))
- Else
- RankData = IIf(RankData = "", rn, IIf(rn < RankData, rn, RankData))
- End If
- Next
- End Function
½Æ»s¥N½X |
|