Excel 从30个汉字,排列组合成4字,能有哪些
1个回答
展开全部
按Alt+F11,打开VBA编辑器,插入一个模块,把下面的代码贴进去,按F5执行
Sub 四字排列()
m = 1
For i = 1 To 30
For j = 1 To 30
For k = 1 To 30
For l = 1 To 30
If Not (i = j Or i = k Or i = l Or j = k Or j = l Or k = l) Then
Cells(m, 3) = Cells(i, 1) & Cells(j, 1) & Cells(k, 1) & Cells(l, 1)
m = m + 1
End If
Next
Next
Next
Next
End Sub
已测试通过:
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询