发布网友 发布时间:2022-05-05 08:45
共5个回答
热心网友 时间:2023-10-25 16:36
自定义一个函数好了。
Function abc()
Dim i As Integer, j As Integer, A(1 To 6) As Integer
For i = 1 To 6
Randomize '更改产生随机数的种子
A(i) = Int(10 * Rnd)
For j = 1 To i - 1
If A(j) = A(i) Then
i = i - 1
Exit For
End If
Next j
Next i
abc = A(1) & A(2) & A(3) & A(4) & A(5) & A(6)
End Function
热心网友 时间:2023-10-25 16:36
使用RAND或RANDBETWEEN函数。热心网友 时间:2023-10-25 16:36
=RANDBETWEEN(0,999999)热心网友 时间:2023-10-25 16:37
=text(int(rand()*999999),"000000")热心网友 时间:2023-10-25 16:38
=IF(LEN(INT(RAND()*1000000))<6,"",INT(RAND()*1000000))热心网友 时间:2023-10-25 16:36
自定义一个函数好了。
Function abc()
Dim i As Integer, j As Integer, A(1 To 6) As Integer
For i = 1 To 6
Randomize '更改产生随机数的种子
A(i) = Int(10 * Rnd)
For j = 1 To i - 1
If A(j) = A(i) Then
i = i - 1
Exit For
End If
Next j
Next i
abc = A(1) & A(2) & A(3) & A(4) & A(5) & A(6)
End Function
热心网友 时间:2023-10-25 16:36
使用RAND或RANDBETWEEN函数。热心网友 时间:2023-10-25 16:37
=RANDBETWEEN(0,999999)热心网友 时间:2023-10-25 16:37
=text(int(rand()*999999),"000000")热心网友 时间:2023-10-25 16:38
=IF(LEN(INT(RAND()*1000000))<6,"",INT(RAND()*1000000))