I want to insert numbers 1 to 12 randomly in Range("E11:E22"), everytime I click on a commandbutton on the page, there must be no duplicate numbers
Please help.
I want to insert numbers 1 to 12 randomly in Range("E11:E22"), everytime I click on a commandbutton on the page, there must be no duplicate numbers
Please help.
Good morning CobraLAD
Does this work OK for your needs :Originally Posted by CobraLAD
HTH![]()
Sub test() Dim rand1(12) T = 0 Randomize For n = 1 To 12 Check1: rand1(n) = Int((12 * Rnd(100)) + 1) For F = 1 To T If rand1(n) = rand1(F) Then GoTo Check1: Next F T = T + 1 Next n For n = 1 To 12 Range("E" & n + 10).Value = rand1(n) Next n End Sub
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks