Hi
Yea, I realised that this would be an issue, but wasn't sure how you would approach it.
Some thoughts:
1) only allow a selection number that is small enough that there is a high chance that you won't get repeats. So if you have 20 cells, then don't allow more than say 6 to be selected.
2) Another option is to keep cycling through the range until you have 10 distinct numbers. Maybe use a collection to store them all, and just keep looping until you reach your count
If you run the code above on a blank spreadsheet, you should get your list of unique numbers. You would have to make variables of the 10 and 20 that I have fixed above - have a look at the original code for ways to do that.
HTH
rylo
Bookmarks