随机把33个号分成三行不重复号码,是吗?Sub test()
Dim arr(1 To 3, 1 To 11)
Dim d As Object
Set d = CreateObject("scripting.dictionary")
Do While k < 33
i = Int(Rnd() * 33 + 1)
If Not d.exists(i) Then
k = k + 1
d(i) = ""
j = j + 1
x = Int((j - 1) / 11) + 1
y = j Mod 11
If y = 0 Then y = 11
arr(x, y) = i
End If
Loop
Range("A1").Resize(3, 11) = arr
End Su