Function orderStr(str As String) As String
Dim s As String
Dim j As Long
Dim n As Long
s = Mid(str, 1, 1)
For j = 1 To Len(str)
If Mid(str, j, 1) < s Then s = Mid(str, j, 1): n = j '计算最小值及其位置。
Next
str = s & Replace(str, s, "", 1, 1) '排序
orderStr = str
End Function