Sub TOP_Value()
'排序
Dim TT As Variant
TT = Array(5, 4, 2, 1, 2)
'由大到小排序
MsgBox Application.WorksheetFunction.Large(TT, 1)
MsgBox Application.WorksheetFunction.Large(TT, 2)
MsgBox Application.WorksheetFunction.Large(TT, 3)
MsgBox Application.WorksheetFunction.Large(TT, 4)
MsgBox Application.WorksheetFunction.Large(TT, 5)
'由小到大排序
MsgBox Application.WorksheetFunction.Small(TT, 1)
MsgBox Application.WorksheetFunction.Small(TT, 2)
MsgBox Application.WorksheetFunction.Small(TT, 3)
MsgBox Application.WorksheetFunction.Small(TT, 4)
MsgBox Application.WorksheetFunction.Small(TT, 5)
End Sub |