求EXCEL的VBA代码,用“1、2、3、4”四个字符,随机生成排列组合
2个回答
展开全部
Sub suiji()
s = Array(1, 2, 3, 4)
For i = 0 To 3
r = Int(Rnd() * 4)
t = s(i)
s(i) = s(r)
s(r) = t
Next
shuchu = ""
For i = 0 To 3
shuchu = shuchu & s(i) & ","
Next
shuchu = Left(shuchu, Len(shuchu) - 1)
Range("A" & Range("A65536").End(xlUp).Row + 1) = shuchu
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询