大家好
想請問要如何排序一個陣列呢(數字由小到大)
dim rbc6 () as doulbe
For T = 1 To 1000
For k = 1 To 12
RBC6(k) = RBC4(T, k)
Next k
在此處想要將rbc6 排序 再進行處理
Next T
謝謝大家了作者: kimbal 時間: 2011-10-25 20:54
Dim First As Integer
Dim Last As Integer
Dim i As Integer
Dim j As Integer
Dim Temp As Double
Dim List As Double
First = LBound(MyArray)
Last = UBound(MyArray)
For i = First To Last - 1
For j = i + 1 To Last
If MyArray(i) > MyArray(j) Then
Temp = MyArray(j)
MyArray(j) = MyArray(i)
MyArray(i) = Temp
End If
Next j
Next i