'*************************************
Dim Data1 As Long
dataLng = Array(3, 6, 5, 8, 7, 9, 4, 2, 1, 10)
'此处如果有输入文件则换成打开文件,读取取到数组中即可
'*************************************
Dim i As Integer, j As Integer, tmp As Integer
Dim N As Integer '数据个数
N = UBound(dataLng)
Debug.Print Now
For i = 0 To N
For j = i + 1 To N
If dataLng(i) < dataLng(j) Then '条件成立 ,则位置交换
tmp = dataLng(j)
dataLng(j) = dataLng(i)
dataLng(i) = tmp
End If
Next j
Next i
Close #1
Open "c:\out.txt" For Output As #1
For i = 0 To N
Print #1, dataLng(i)
Next i
Close #1