'这么麻烦,只能用VBA了,就是排列组合。
Sub arrange()
Dim str, str1, str2, str3, str4, str5, cnt, cut
str = "123456"
Count = 0
cnt = 1
cut = 1
For i = 1 To Len(str)
str1 = Replace(str, Mid(str, i, 1), "")
For j = 1 To Len(str1)
str2 = Replace(str1, Mid(str1, j, 1), "")
For k = 1 To Len(str2)
str3 = Replace(str2, Mid(str2, k, 1), "")
For l = 1 To Len(str3)
str4 = Replace(str3, Mid(str3, l, 1), "")
For m = 1 To Len(str4)
str5 = Replace(str4, Mid(str4, m, 1), "")
For n = 1 To Len(str5)
Cells(cnt, cut) = Mid(str, i, 1) & Mid(str1, j, 1) & Mid(str2, k, 1) & Mid(str3, l, 1) & Mid(str4, m, 1) & Mid(str5, n, 1)
cnt = cnt + 1
Count = Count + 1
If cnt = 61 Then
cnt = 1
cut = cut + 1
End If
Next
Next
Next
Next
Next
Next
MsgBox Count
End Sub
不懂vba就不好办了,你看下附件吧。Alt+F11可打开代码窗口。