Perché non utilizzare le funzioni di .NET?
Dim MyRnd As New Random
MyRnd.Next(m, M) (restituisce un numero random intero compreso tra m e M-1)