|
Sub 分配()
Range("l2:n62") = ""
Dim d As New Dictionary
Dim rg As Range
Dim x, K1, K2, K3
For x = 2 To 61
100:
K1 = Rnd() * 0.03
If d.Exists(K1) Then GoTo 100
Cells(x, "l") = K1
200:
K2 = Rnd() * 0.03
If d.Exists(K2) Then GoTo 200
Cells(x, "m") = K2
300:
K3 = Rnd() * 0.03
If d.Exists(K3) Then GoTo 300
Cells(x, "n") = K3
If Cells(x, "k") < 0 Or Cells(x, "k") > 1000000 Then GoTo 100
Next x
Range("l62") = -[l64]
Range("M62") = -[M64]
Range("N62") = -[N64]
End Sub |
|