[COLOR="Navy"]Sub[/COLOR] MG01Oct26
Static nums
Static c
Static temp
[COLOR="Navy"]Dim[/COLOR] Txt [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String[/COLOR]
[COLOR="Navy"]Dim[/COLOR] oRnd [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Dim[/COLOR] n
Randomize
[COLOR="Navy"]If[/COLOR] c = 0 [COLOR="Navy"]Then[/COLOR]
Columns("A:A").ClearContents
nums = Array(0, 1, 3, 4, 5, 7, 8, 10, 14, 17, 18, 29, 38, 40, 45, 50, 53)
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]If[/COLOR] UBound(nums) > 0 [COLOR="Navy"]Then[/COLOR]
oRnd = Int(Rnd * UBound(nums)) + 1
c = c + 1
Cells(c, 1) = nums(oRnd) '[COLOR="Green"][B]Remove sheet Nums if required[/B][/COLOR]
c = IIf(c = 16, 0, c)
MsgBox nums(oRnd)
[COLOR="Navy"]For[/COLOR] n = 0 To UBound(nums)
[COLOR="Navy"]If[/COLOR] Not nums(n) = nums(oRnd) [COLOR="Navy"]Then[/COLOR] Txt = Txt & nums(n) & ","
[COLOR="Navy"]Next[/COLOR] n
Txt = Left(Txt, Len(Txt) - 1)
nums = Split(Txt, ",")
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]If[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]