'定义变量 Dim arr1 '数组赋值 arr1 = array(3, 6, 8, 7, 1, 2, 9,10) For m = 0 To UBound(arr1) For i = m+1 To UBound(arr1) k=arr1(m) If arr1(m) < arr1(i) Then arr1(m) = arr1(i) arr1(i) = k End If Next msgbox arr1(m) Next