Good afternoon krabople
Originally Posted by
krabople
Hi, I need some code so that when I press a button, the ten cells above are each given a random number between 1 and 10. So far I have written the following, although obviously this doesn't ensure that all numbers are different
Next time you post code, please remember to use code tags (the little "#" button). I've done it for you on this occasion.
The best way I have found to do this is put all the numbers into an array and check each time one is added that the number isn't already there - if it is, loop back and do it again.
This code should work OK :
HTH
DominicB
Bookmarks