Excel vba编程怎么输出排列组合
1个回答
展开全部
Dim i%, k%
Sub s()
arr = [a1].CurrentRegion
For i = 1 To UBound(arr)
k = 3
p arr(i, 1)
Next
End Sub
Sub p(ByVal t1$, Optional ByVal t2$ = "")
Dim l%, t$, tt1$, tt2$
l = Len(t1)
If l = 1 Then
Cells(i, k) = t2 & t1
k = k + 1
Else
For j = 1 To l
t = Mid(t1, j, 1)
tt1 = Replace(t1, t, "", , 1)
tt2 = t2 & t
p tt1, tt2
Next
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询