Sub tt() Dim m As Long Dim d As Object Set d = CreateObject("scripting.dictionary") Do m = Int(Rnd() * 101) d(m) = "" Loop Until d.Count = 10 Range("A2:A11") = Application.Transpose(d.keys) End Sub
Sub tt() Dim m As Long Dim d As Object Set d = CreateObject("scripting.dictionary") Do m = Int(Rnd() * 101) d(m) = "" Loop Until d.Count = 10 Range("A2:A11") = Application.Transpose(d.keys) End Sub
Sub aa() Dim i As Long i = 100 Dim num As Long ReDim arr(i) As Long ReDim arr2(i, 0) As Long Dim x As Long For x = 0 To i arr(x) = x Next x For x = 0 To i num = Int(Rnd() * (i - x)) arr2(x, 0) = arr(num) arr(num) = arr(i - x) Next x Range("A2:A11") = arr2 End Sub