Excel VBA中对一个数组中的值求最值

如题所述

求最大值为例
for i=0 to ubound(arr)
for j=i+1 to ubound(arr)
if arr(i)<arr(j) then
temp=arr(i)
arr(i)=arr(j)
arr(j)=temp
end if
enxt j
next i
msgbox arr(0)
温馨提示:答案为网友推荐,仅供参考
相似回答