本帖最后由 chrisfang 于 2014-2-15 12:07 编辑
Sub 升序() [b1:b9] = [SMALL(A1:A9,ROW(A1:A9))*ROW(A1:A9)^0] End Sub Sub 降序() [c1:c9] = [LARGE(A1:A9,ROW(A1:A9))*ROW(A1:A9)^0] End Sub
当然也可以把它交给数组 貌似这个螃蟹是偶第一个吃的 补充(行数不能确定时) Sub 降序() Dim m%, arr, arra(), x% m = [COUNTA(A:A)] arr = [LARGE(A:A,ROW(A:A))*ROW(A:A)^0] ReDim arra(1 To m, 1 To 1) For x = 1 To m arra(x, 1) = arr(x, 1) Next Range("c1").Resize(m, 1) = arra End Sub 下面这些语句感觉很有实用性 MsgBox [MAX(1*LEFT(A1:A10000,2))] MsgBox [MAX(1*MID(A1:A10000,1,2))] MsgBox [max(len(a1:a10000))]
相关帖链接 http://club.excelhome.net/viewthread.php?tid=341253&px=0
[此贴子已经被作者于2008-7-26 22:01:15编辑过] |