|
或者这样。- Sub GetDiff()
- Dim arr(1 To 10, 1 To 10)
- Dim x$, up&, low&
- Dim i%, j%
- up = 999999999: low = 111111111
- For i = 1 To 10
- For j = 1 To 10
- x = CStr(Int(Rnd * (up - low + 1) + low))
- x = Replace(x, "0", Int(Rnd * 9 + 1))
- arr(i, j) = x
- Next
- Next
- Range("a1:j10") = arr
- End Sub
复制代码 |
|