Excel vba编程怎么输出排列组合
答案:1 悬赏:10 手机版
解决时间 2021-01-27 19:45
- 提问者网友:刺鸟
- 2021-01-27 08:03
Excel vba编程怎么输出排列组合
最佳答案
- 五星知识达人网友:鱼忧
- 2021-01-27 09:25
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
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
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯