I want to generate 10 different numbers from a range of 0-9. the desired output may look like this, 9 0 8 6 5 3 2 4 1 7
Dim arraynum(9) As Integer Dim crmd A
Having no performance requirements specified, I would use the below short and simple code:
Randomize With CreateObject("Scripting.Dictionary") Do .Item(Int(Rnd * 10)) = "" Loop Until .Count = 10 MsgBox Join(.Keys) End With